squakez commented on code in PR #6845:
URL: https://github.com/apache/camel-k/pull/6845#discussion_r4095234235


##########
pkg/util/bindings/arkmq.go:
##########
@@ -0,0 +1,289 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package bindings
+
+import (
+       "fmt"
+       "net"
+       "strconv"
+
+       camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+       arkmqv1beta1 "github.com/apache/camel-k/v2/pkg/apis/duck/arkmq/v1beta1"
+       "github.com/apache/camel-k/v2/pkg/util/kubernetes"
+       "github.com/apache/camel-k/v2/pkg/util/uri"
+       "k8s.io/apimachinery/pkg/runtime/schema"
+       ctrl "sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+func init() {
+       RegisterBindingProvider(ArkMQBindingProvider{})
+}
+
+// camelArkMQ represents the configuration required by Camel JMS component for 
ArkMQ.
+type camelArkMQ struct {
+       queueName  string
+       properties map[string]string
+}
+
+// defaultArtemisPort is the default core port for ActiveMQ Artemis.
+const defaultArtemisPort = int32(61616)
+
+// ArkMQBindingProvider allows connecting to an ArkMQ queue via Binding.
+type ArkMQBindingProvider struct{}
+
+func (a ArkMQBindingProvider) ID() string {
+       return "arkmq"
+}
+
+func (a ArkMQBindingProvider) Translate(ctx BindingContext, _ EndpointContext, 
endpoint camelv1.Endpoint) (*Binding, error) {
+       if endpoint.Ref == nil {
+               // IMPORTANT: just pass through if this provider cannot manage 
the binding. Another provider in the chain may take care of it.
+               return nil, nil
+       }
+       gv, err := schema.ParseGroupVersion(endpoint.Ref.APIVersion)
+       if err != nil {
+               return nil, err
+       }
+       if gv.Group != arkmqv1beta1.ArkMQGroup {
+               // IMPORTANT: just pass through if this provider cannot manage 
the binding. Another provider in the chain may take care of it.
+               return nil, nil
+       }
+
+       camelArkMQ, err := a.toCamelArkMQ(ctx, endpoint)
+       if err != nil {
+               return nil, err
+       }
+       arkmqURI := "jms:queue:" + camelArkMQ.queueName

Review Comment:
   Not sure if we should use `jms` component. This one requires a bean to 
manage connection. We should probably have better luck with params encoding 
from `amqp` component: 
https://camel.apache.org/components/next/amqp-component.html



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to