davsclaus commented on code in PR #108:
URL: 
https://github.com/apache/camel-spring-boot-examples/pull/108#discussion_r1228964184


##########
artemis/pom.xml:
##########
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>4.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-artemis</artifactId>
+    <name>Camel SB Examples :: artemis</name>
+    <description>An example showing how to work with Camel, ActiveMQ Artemis 
Amqp and Spring Boot</description>
+
+    <properties>
+        <category>Messaging</category>
+
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+
+    <dependencyManagement>
+
+        <dependencies>
+            <!-- Spring Boot BOM -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+            <!-- Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel.springboot</groupId>
+                <artifactId>camel-spring-boot-bom</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+
+    </dependencyManagement>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-artemis</artifactId>
+        </dependency>
+
+        <!-- Camel -->
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-jms-client</artifactId>
+            <version>${artemis-jms-client-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-jms</artifactId>

Review Comment:
   you do not need this as you should only use -starter for Camel JARs



##########
artemis/src/main/data/.camel/ReadMe.txt:
##########
@@ -0,0 +1,43 @@
+example project which connects to A-MQ 7 from Fuse 7, using remote A-MQ address

Review Comment:
   Maybe this .camel file was added by mistake



##########
artemis/src/main/java/sample/camel/JmsConfig.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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 sample.camel;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import jakarta.jms.JMSException;
+
+@Configuration
+public class JmsConfig {
+
+    @Value("${ARTEMIS_HOST}")
+    private String artemisHost;
+    @Value("${ARTEMIS_SERVICE_PORT}")
+    private String artemisPort;
+    @Value("${ARTEMIS_SERVICE_USERNAME}")
+    private String userName;
+    @Value("${ARTEMIS_SERVICE_PASSWORD}")
+    private String pass;
+    @Value("${ARTEMIS_REMOTE_URI}")
+    private String remoteUri;
+
+    public String getArtemisHost() {
+       return artemisHost;
+    }
+
+    public void setArtemisHost(String artemisHost) {
+       this.artemisHost = artemisHost;
+    }
+
+    public String getArtemisPort() {
+        return artemisPort;
+    }
+
+    public void setArtemisPort(String artemisPort) {
+        this.artemisPort = artemisPort;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPass() {
+        return pass;
+    }
+
+    public void setPass(String pass) {
+        this.pass = pass;
+    }
+
+    public String getRemoteUri() {
+        return remoteUri;
+    }
+    
+    public void setRemoteUri(String remoteUri) {
+        this.remoteUri = remoteUri;
+    }
+
+    @Bean
+    public org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory 
artemisConnectionFactory() throws JMSException{

Review Comment:
   Can we not do this better? Why should end users write a java class to 
configure Artemis? This is bad. I assume SB has a -starter auto configuration 
we can use or something.



##########
artemis/src/main/java/sample/camel/SampleAutowiredAmqpRoute.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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 sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SampleAutowiredAmqpRoute extends RouteBuilder {
+
+    @Autowired ActiveMQJMSConnectionFactory artemisConnectionFactory;
+    @Bean
+    public org.apache.camel.component.jms.JmsComponent jms() {

Review Comment:
   We should find a way to make this not needed, eg a SB artemis starter or 
something.



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to