This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-examples.git
The following commit(s) were added to refs/heads/master by this push: new be9568c CAMEL-16170: Modularize camel-spring be9568c is described below commit be9568c0b13d2187ea958977b17145bca114c29e Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Feb 11 17:03:00 2021 +0100 CAMEL-16170: Modularize camel-spring --- examples/README.adoc | 5 +- examples/camel-example-activemq-tomcat/pom.xml | 2 +- examples/camel-example-aggregate-dist/pom.xml | 2 +- examples/camel-example-aggregate/pom.xml | 4 + examples/camel-example-artemis/pom.xml | 5 + examples/camel-example-as2/pom.xml | 4 + examples/camel-example-cafe/pom.xml | 4 + .../camel-example-cassandra-kubernetes/pom.xml | 4 + examples/camel-example-console/pom.xml | 4 + examples/camel-example-cxf-proxy/pom.xml | 6 +- examples/camel-example-cxf-tomcat/pom.xml | 2 +- examples/camel-example-cxf/pom.xml | 2 +- .../camel-example-hazelcast-kubernetes/pom.xml | 4 + examples/camel-example-jdbc/pom.xml | 4 + examples/camel-example-jmx/pom.xml | 4 + examples/camel-example-jooq/pom.xml | 4 + examples/camel-example-loadbalancing/pom.xml | 4 + examples/camel-example-loan-broker-cxf/pom.xml | 6 +- examples/camel-example-loan-broker-jms/pom.xml | 2 +- examples/camel-example-micrometer/pom.xml | 6 +- examples/camel-example-pojo-messaging/pom.xml | 4 + examples/camel-example-servlet-tomcat/pom.xml | 2 +- examples/camel-example-spring-javaconfig/pom.xml | 7 +- examples/camel-example-spring-jms/README.adoc | 53 ------ examples/camel-example-spring-jms/pom.xml | 183 ------------------- .../apache/camel/example/client/CamelClient.java | 60 ------ .../camel/example/client/CamelClientEndpoint.java | 88 --------- .../camel/example/client/CamelClientRemoting.java | 60 ------ .../apache/camel/example/server/Multiplier.java | 34 ---- .../apache/camel/example/server/ServerRoutes.java | 49 ----- .../org/apache/camel/example/server/Treble.java | 34 ---- .../src/main/resources/META-INF/LICENSE.txt | 203 --------------------- .../src/main/resources/META-INF/NOTICE.txt | 11 -- .../resources/META-INF/spring/camel-server.xml | 74 -------- .../src/main/resources/camel-client-remoting.xml | 54 ------ .../src/main/resources/camel-client.xml | 53 ------ .../src/main/resources/camel.properties | 19 -- .../src/main/resources/log4j2.properties | 23 --- .../example/SpringJmsClientRemotingServerTest.java | 66 ------- .../camel/example/SpringJmsClientServerTest.java | 89 --------- examples/camel-example-spring-pulsar/pom.xml | 4 + examples/camel-example-spring-security/pom.xml | 2 +- examples/camel-example-spring-ws/pom.xml | 2 +- examples/camel-example-spring-xquery/pom.xml | 4 + examples/camel-example-spring/pom.xml | 4 + examples/camel-example-transformer-demo/pom.xml | 2 +- examples/camel-example-widget-gadget-java/pom.xml | 4 + examples/camel-example-widget-gadget-xml/pom.xml | 4 + examples/pom.xml | 1 - 49 files changed, 99 insertions(+), 1172 deletions(-) diff --git a/examples/README.adoc b/examples/README.adoc index a4b58d0..a107af6 100644 --- a/examples/README.adoc +++ b/examples/README.adoc @@ -11,7 +11,7 @@ View the individual example READMEs for details. == Examples // examples: START -Number of Examples: 88 (0 deprecated) +Number of Examples: 87 (0 deprecated) [width="100%",cols="4,2,4",options="header"] |=== @@ -167,9 +167,6 @@ Number of Examples: 88 (0 deprecated) | link:camel-example-netty-custom-correlation/readme.adoc[Netty Custom Correlation] (camel-example-netty-custom-correlation) | Messaging | An example for showing Camel Netty with custom codec and correlation id -| link:camel-example-spring-jms/README.adoc[Spring JMS] (camel-example-spring-jms) | Messaging | An example using Spring XML to talk to the JMS server from different kind of client techniques - - | link:camel-example-spring-pulsar/README.adoc[Spring Pulsar] (camel-example-spring-pulsar) | Messaging | An example using Spring XML to talk to the Pulsar server from different kind of client techniques | link:camel-example-vertx-kafka/README.adoc[Vertx Kafka] (camel-example-vertx-kafka) | Messaging | An example for Vertx Kafka diff --git a/examples/camel-example-activemq-tomcat/pom.xml b/examples/camel-example-activemq-tomcat/pom.xml index 050ef08..8724bd9 100644 --- a/examples/camel-example-activemq-tomcat/pom.xml +++ b/examples/camel-example-activemq-tomcat/pom.xml @@ -89,7 +89,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <!-- we use spring web to kick-start the application in web.xml --> diff --git a/examples/camel-example-aggregate-dist/pom.xml b/examples/camel-example-aggregate-dist/pom.xml index 0310657..5064ca9 100644 --- a/examples/camel-example-aggregate-dist/pom.xml +++ b/examples/camel-example-aggregate-dist/pom.xml @@ -68,7 +68,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-aggregate/pom.xml b/examples/camel-example-aggregate/pom.xml index 0080def..38c5f10 100644 --- a/examples/camel-example-aggregate/pom.xml +++ b/examples/camel-example-aggregate/pom.xml @@ -60,6 +60,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-stream</artifactId> </dependency> diff --git a/examples/camel-example-artemis/pom.xml b/examples/camel-example-artemis/pom.xml index d8cd98a..793c719 100644 --- a/examples/camel-example-artemis/pom.xml +++ b/examples/camel-example-artemis/pom.xml @@ -64,6 +64,11 @@ <artifactId>camel-jms</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-main</artifactId> + </dependency> + <!-- Artemis client --> <dependency> <groupId>org.apache.activemq</groupId> diff --git a/examples/camel-example-as2/pom.xml b/examples/camel-example-as2/pom.xml index a17b22b..71823f0 100644 --- a/examples/camel-example-as2/pom.xml +++ b/examples/camel-example-as2/pom.xml @@ -68,6 +68,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-test-spring</artifactId> </dependency> diff --git a/examples/camel-example-cafe/pom.xml b/examples/camel-example-cafe/pom.xml index 1e153e6..5e41563 100644 --- a/examples/camel-example-cafe/pom.xml +++ b/examples/camel-example-cafe/pom.xml @@ -57,6 +57,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-timer</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-cassandra-kubernetes/pom.xml b/examples/camel-example-cassandra-kubernetes/pom.xml index fadc364..7d5de13 100644 --- a/examples/camel-example-cassandra-kubernetes/pom.xml +++ b/examples/camel-example-cassandra-kubernetes/pom.xml @@ -63,6 +63,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-console/pom.xml b/examples/camel-example-console/pom.xml index 5cb7c2b..dfb5098 100644 --- a/examples/camel-example-console/pom.xml +++ b/examples/camel-example-console/pom.xml @@ -61,6 +61,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-stream</artifactId> </dependency> diff --git a/examples/camel-example-cxf-proxy/pom.xml b/examples/camel-example-cxf-proxy/pom.xml index 39ba9e6..b12cc97 100644 --- a/examples/camel-example-cxf-proxy/pom.xml +++ b/examples/camel-example-cxf-proxy/pom.xml @@ -58,7 +58,7 @@ <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> @@ -75,6 +75,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <!-- cxf --> <!-- used by the real web service --> diff --git a/examples/camel-example-cxf-tomcat/pom.xml b/examples/camel-example-cxf-tomcat/pom.xml index ce73832..34e4346 100644 --- a/examples/camel-example-cxf-tomcat/pom.xml +++ b/examples/camel-example-cxf-tomcat/pom.xml @@ -89,7 +89,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-cxf/pom.xml b/examples/camel-example-cxf/pom.xml index 4deaedf..7ebcec6 100644 --- a/examples/camel-example-cxf/pom.xml +++ b/examples/camel-example-cxf/pom.xml @@ -57,7 +57,7 @@ <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-hazelcast-kubernetes/pom.xml b/examples/camel-example-hazelcast-kubernetes/pom.xml index 4b745c9..a134f23 100644 --- a/examples/camel-example-hazelcast-kubernetes/pom.xml +++ b/examples/camel-example-hazelcast-kubernetes/pom.xml @@ -60,6 +60,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-jdbc/pom.xml b/examples/camel-example-jdbc/pom.xml index 4ddc6ee..4e2fbba 100644 --- a/examples/camel-example-jdbc/pom.xml +++ b/examples/camel-example-jdbc/pom.xml @@ -63,6 +63,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-jdbc</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-jmx/pom.xml b/examples/camel-example-jmx/pom.xml index 41382d2..09c9653 100644 --- a/examples/camel-example-jmx/pom.xml +++ b/examples/camel-example-jmx/pom.xml @@ -61,6 +61,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-jooq/pom.xml b/examples/camel-example-jooq/pom.xml index 9de218a..c8bae0a 100644 --- a/examples/camel-example-jooq/pom.xml +++ b/examples/camel-example-jooq/pom.xml @@ -60,6 +60,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-jooq</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-loadbalancing/pom.xml b/examples/camel-example-loadbalancing/pom.xml index 78cf32c..d0b9917 100644 --- a/examples/camel-example-loadbalancing/pom.xml +++ b/examples/camel-example-loadbalancing/pom.xml @@ -62,6 +62,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-mina</artifactId> </dependency> diff --git a/examples/camel-example-loan-broker-cxf/pom.xml b/examples/camel-example-loan-broker-cxf/pom.xml index c518367..8af2a53 100644 --- a/examples/camel-example-loan-broker-cxf/pom.xml +++ b/examples/camel-example-loan-broker-cxf/pom.xml @@ -58,7 +58,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> @@ -66,6 +66,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-cxf</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-loan-broker-jms/pom.xml b/examples/camel-example-loan-broker-jms/pom.xml index 692f970..75f9b0e 100644 --- a/examples/camel-example-loan-broker-jms/pom.xml +++ b/examples/camel-example-loan-broker-jms/pom.xml @@ -58,7 +58,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-micrometer/pom.xml b/examples/camel-example-micrometer/pom.xml index e3402dd..7a872cf 100644 --- a/examples/camel-example-micrometer/pom.xml +++ b/examples/camel-example-micrometer/pom.xml @@ -54,7 +54,7 @@ <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> @@ -70,6 +70,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-bean</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-direct</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-pojo-messaging/pom.xml b/examples/camel-example-pojo-messaging/pom.xml index ac630ee..4da05e7 100644 --- a/examples/camel-example-pojo-messaging/pom.xml +++ b/examples/camel-example-pojo-messaging/pom.xml @@ -95,6 +95,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-servlet-tomcat/pom.xml b/examples/camel-example-servlet-tomcat/pom.xml index 999bf9e..3d76263 100644 --- a/examples/camel-example-servlet-tomcat/pom.xml +++ b/examples/camel-example-servlet-tomcat/pom.xml @@ -59,7 +59,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-spring-javaconfig/pom.xml b/examples/camel-example-spring-javaconfig/pom.xml index 56fec1b..eabdeed 100644 --- a/examples/camel-example-spring-javaconfig/pom.xml +++ b/examples/camel-example-spring-javaconfig/pom.xml @@ -54,7 +54,7 @@ <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> @@ -63,9 +63,12 @@ <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-bean</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-file</artifactId> </dependency> - <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jms</artifactId> diff --git a/examples/camel-example-spring-jms/README.adoc b/examples/camel-example-spring-jms/README.adoc deleted file mode 100644 index c3a998f..0000000 --- a/examples/camel-example-spring-jms/README.adoc +++ /dev/null @@ -1,53 +0,0 @@ -== Spring & JMS Example - -=== Introduction - -This example shows how to work with the Camel-JMS Component. - -The example consumes messages from a queue and invoke the bean with the -received message. - -The Server is required to be running when you try the clients. - -And for the Client we have a total of three flavors: - Normal use the -ProducerTemplate ala Spring Template style - Using Spring Remoting for -powerful ``Client doesn’t know at all its a remote call'' - And using -the Message Endpoint pattern using the neutral Camel API - -=== Build - -You will need to compile this example first: - -.... -mvn compile -.... - -=== Run - -The example should run if you type: - -==== Step 1: Run Server - -.... -mvn exec:java -PCamelServer -.... - -==== Step 2: Run Clients - -.... -mvn exec:java -PCamelClient -mvn exec:java -PCamelClientRemoting -mvn exec:java -PCamelClientEndpoint -.... - -To stop the example hit ctrl+c - -=== Help and contributions - -If you hit any problem using Camel or have some feedback, then please -https://camel.apache.org/support.html[let us know]. - -We also love contributors, so -https://camel.apache.org/contributing.html[get involved] :-) - -The Camel riders! diff --git a/examples/camel-example-spring-jms/pom.xml b/examples/camel-example-spring-jms/pom.xml deleted file mode 100644 index a7f4e53..0000000 --- a/examples/camel-example-spring-jms/pom.xml +++ /dev/null @@ -1,183 +0,0 @@ -<?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/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.example</groupId> - <artifactId>examples</artifactId> - <version>3.8.0-SNAPSHOT</version> - </parent> - - <artifactId>camel-example-spring-jms</artifactId> - <packaging>jar</packaging> - <name>Camel :: Example :: Spring :: JMS</name> - <description>An example using Spring XML to talk to the JMS server from different kind of client techniques - </description> - - <properties> - <category>Messaging</category> - <title>Spring JMS</title> - </properties> - - <dependencyManagement> - <dependencies> - <!-- Add Camel BOM --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-bom</artifactId> - <version>${camel.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <dependencies> - <!-- START SNIPPET: e1 --> - <!-- required by both client and server --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jms</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-spring-main</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-bean</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-activemq</artifactId> - <!-- lets use JMS 2.0 api but camel-jms still works with ActiveMQ 5.x that is JMS 1.1 only --> - <exclusions> - <exclusion> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jms_1.1_spec</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>activemq-pool</artifactId> - <version>${activemq-version}</version> - <!-- lets use JMS 2.0 api but camel-jms still works with ActiveMQ 5.x that is JMS 1.1 only --> - <exclusions> - <exclusion> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jms_1.1_spec</artifactId> - </exclusion> - </exclusions> - </dependency> - <!-- END SNIPPET: e1 --> - - <!-- START SNIPPET: e2 --> - <!-- xbean is required for ActiveMQ broker configuration in the spring xml file --> - <dependency> - <groupId>org.apache.xbean</groupId> - <artifactId>xbean-spring</artifactId> - <version>${xbean-spring-version}</version> - </dependency> - <!-- END SNIPPET: e2 --> - - <!-- logging --> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${log4j2-version}</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${log4j2-version}</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <version>${log4j2-version}</version> - <scope>runtime</scope> - </dependency> - - <!-- for testing --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <profiles> - <profile> - <id>CamelServer</id> - <properties> - <!-- we use Camel spring Main class as the server got all what it needs to start in the camel-server.xml file --> - <target.main.class>org.apache.camel.spring.Main</target.main.class> - <target.cmd.args>-ac META-INF/spring/camel-server.xml</target.cmd.args> - </properties> - </profile> - <profile> - <id>CamelClient</id> - <properties> - <!-- we start using our own class to control what we do in the main --> - <target.main.class>org.apache.camel.example.client.CamelClient</target.main.class> - </properties> - </profile> - <profile> - <id>CamelClientRemoting</id> - <properties> - <!-- we start using our own class to control what we do in the main --> - <target.main.class>org.apache.camel.example.client.CamelClientRemoting</target.main.class> - </properties> - </profile> - <profile> - <id>CamelClientEndpoint</id> - <properties> - <!-- we start using our own class to control what we do in the main --> - <target.main.class>org.apache.camel.example.client.CamelClientEndpoint</target.main.class> - </properties> - </profile> - </profiles> - <build> - - <plugins> - - <!-- Allows the example to be run via 'mvn compile exec:java' --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <mainClass>${target.main.class}</mainClass> - <includePluginDependencies>false</includePluginDependencies> - <commandlineArgs>${target.cmd.args}</commandlineArgs> - </configuration> - </plugin> - </plugins> - - </build> -</project> diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java deleted file mode 100644 index 33958e7..0000000 --- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 org.apache.camel.example.client; - -import org.apache.camel.ProducerTemplate; -import org.apache.camel.util.IOHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * Client that uses the {@link ProducerTemplate} to easily exchange messages with the Server. - * <p/> - * Requires that the JMS broker is running, as well as CamelServer - */ -public final class CamelClient { - - private static final Logger LOG = LoggerFactory.getLogger(CamelClient.class); - - private CamelClient() { - // Helper class - } - - // START SNIPPET: e1 - public static void main(final String[] args) throws Exception { - LOG.info("Notice this client requires that the CamelServer is already running!"); - - AbstractApplicationContext context = new ClassPathXmlApplicationContext("camel-client.xml"); - - // get the camel template for Spring template style sending of messages (= producer) - ProducerTemplate camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class); - - LOG.info("Invoking the multiply with 22"); - - // as opposed to the CamelClientRemoting example we need to define the service URI in this java code - int response = camelTemplate.requestBody("jms:queue:numbers", 22, int.class); - - LOG.info("... the result is: {}", response); - - // we're done so let's properly close the application context - IOHelper.close(context); - } - // END SNIPPET: e1 - -} diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java deleted file mode 100644 index d80d632..0000000 --- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientEndpoint.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 org.apache.camel.example.client; - -import org.apache.camel.CamelContext; -import org.apache.camel.Endpoint; -import org.apache.camel.Exchange; -import org.apache.camel.ExchangePattern; -import org.apache.camel.Producer; -import org.apache.camel.util.IOHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * Client that uses the <a href="http://camel.apache.org/message-endpoint.html">Mesage Endpoint</a> - * pattern to easily exchange messages with the Server. - * <p/> - * Notice this very same API can use for all components in Camel, so if we were using TCP communication instead - * of JMS messaging we could just use <code>camel.getEndpoint("mina:tcp://someserver:port")</code>. - * <p/> - * Requires that the JMS broker is running, as well as CamelServer - */ -public final class CamelClientEndpoint { - - private static final Logger LOG = LoggerFactory.getLogger(CamelClientEndpoint.class); - - private CamelClientEndpoint() { - //Helper class - } - - // START SNIPPET: e1 - public static void main(final String[] args) throws Exception { - LOG.info("Notice this client requires that the CamelServer is already running!"); - - AbstractApplicationContext context = new ClassPathXmlApplicationContext("camel-client.xml"); - CamelContext camel = context.getBean("camel-client", CamelContext.class); - - // get the endpoint from the camel context - Endpoint endpoint = camel.getEndpoint("jms:queue:numbers"); - - // create the exchange used for the communication - // we use the in out pattern for a synchronized exchange where we expect a response - Exchange exchange = endpoint.createExchange(ExchangePattern.InOut); - // set the input on the in body - // must be correct type to match the expected type of an Integer object - exchange.getIn().setBody(11); - - // to send the exchange we need an producer to do it for us - Producer producer = endpoint.createProducer(); - // start the producer so it can operate - producer.start(); - - // let the producer process the exchange where it does all the work in this oneline of code - LOG.info("Invoking the multiply with 11"); - - producer.process(exchange); - - // get the response from the out body and cast it to an integer - int response = exchange.getMessage().getBody(int.class); - - LOG.info("... the result is: {}", response); - - // stopping the JMS producer has the side effect of the "ReplyTo Queue" being properly - // closed, making this client not to try any further reads for the replies from the server - producer.stop(); - - // we're done so let's properly close the application context - IOHelper.close(context); - } - // END SNIPPET: e1 - -} diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java deleted file mode 100644 index 78582af..0000000 --- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 org.apache.camel.example.client; - -import org.apache.camel.example.server.Multiplier; -import org.apache.camel.util.IOHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * Client that uses Camel Spring Remoting for very easy integration with the server. - * <p/> - * Requires that the JMS broker is running, as well as CamelServer - */ -public final class CamelClientRemoting { - - private static final Logger LOG = LoggerFactory.getLogger(CamelClientRemoting.class); - - private CamelClientRemoting() { - //Helper class - } - - // START SNIPPET: e1 - public static void main(final String[] args) { - LOG.info("Notice this client requires that the CamelServer is already running!"); - - AbstractApplicationContext context = new ClassPathXmlApplicationContext("camel-client-remoting.xml"); - // just get the proxy to the service and we as the client can use the "proxy" as it was - // a local object we are invoking. Camel will under the covers do the remote communication - // to the remote ActiveMQ server and fetch the response. - Multiplier multiplier = context.getBean("multiplierProxy", Multiplier.class); - - LOG.info("Invoking the multiply with 33"); - - int response = multiplier.multiply(33); - - LOG.info("... the result is: {}", response); - - // we're done so let's properly close the application context - IOHelper.close(context); - } - // END SNIPPET: e1 - -} diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java deleted file mode 100644 index 32bb4f7..0000000 --- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 org.apache.camel.example.server; - -/** - * Our business service. - */ -// START SNIPPET: e1 -public interface Multiplier { - - /** - * Multiplies the given number by a pre-defined constant. - * - * @param originalNumber The number to be multiplied - * @return The result of the multiplication - */ - int multiply(int originalNumber); - -} -// END SNIPPET: e1 diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java deleted file mode 100644 index 5f4cc3f..0000000 --- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 org.apache.camel.example.server; - -import org.apache.camel.builder.RouteBuilder; - -/** - * This class defines the routes on the Server. The class extends a base class in Camel {@link RouteBuilder} - * that can be used to easily setup the routes in the configure() method. - */ -// START SNIPPET: e1 -public class ServerRoutes extends RouteBuilder { - - @Override - public void configure() throws Exception { - // route from the numbers queue to our business that is a spring bean registered with the id=multiplier - // Camel will introspect the multiplier bean and find the best candidate of the method to invoke. - // You can add annotations etc to help Camel find the method to invoke. - // As our multiplier bean only have one method its easy for Camel to find the method to use. - from("jms:queue:numbers").to("bean:multiplier"); - - // Camel has several ways to configure the same routing, we have defined some of them here below - - // as above but with the bean: prefix - //from("jms:queue:numbers").to("bean:multiplier"); - - // bean is using explicit bean bindings to lookup the multiplier bean and invoke the multiply method - //from("jms:queue:numbers").bean("multiplier", "multiply"); - - // the same as above but expressed as a URI configuration - //from("jms:queue:numbers").to("bean:multiplier?method=multiply"); - } - -} -// END SNIPPET: e1 diff --git a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java b/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java deleted file mode 100644 index 8fb2b09..0000000 --- a/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 org.apache.camel.example.server; - -import org.springframework.stereotype.Service; - -/** - * This is the implementation of the business service. - */ -// START SNIPPET: e1 -@Service(value = "multiplier") -public class Treble implements Multiplier { - - @Override - public int multiply(final int originalNumber) { - return originalNumber * 3; - } - -} -// END SNIPPET: e1 diff --git a/examples/camel-example-spring-jms/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-spring-jms/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 6b0b127..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. - diff --git a/examples/camel-example-spring-jms/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-spring-jms/src/main/resources/META-INF/NOTICE.txt deleted file mode 100644 index 2e215bf..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/META-INF/NOTICE.txt +++ /dev/null @@ -1,11 +0,0 @@ - ========================================================================= - == NOTICE file corresponding to the section 4 d of == - == the Apache License, Version 2.0, == - == in this case for the Apache Camel distribution. == - ========================================================================= - - This product includes software developed by - The Apache Software Foundation (http://www.apache.org/). - - Please read the different LICENSE files present in the licenses directory of - this distribution. diff --git a/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml b/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml deleted file mode 100644 index 7b3c849..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?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. - ---> -<!-- START SNIPPET: e1 --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xmlns:camel="http://camel.apache.org/schema/spring" - xmlns:broker="http://activemq.apache.org/schema/core" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd - http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> - <!-- END SNIPPET: e1 --> - - <!-- START SNIPPET: e2 --> - <!-- let Spring do its IoC stuff in this package --> - <context:component-scan base-package="org.apache.camel.example.server"/> - <!-- END SNIPPET: e2 --> - - <!-- spring property placeholder, ignore resource not found as the file resource is for unit testing --> - <context:property-placeholder location="classpath:camel.properties,file:target/custom.properties" - ignore-resource-not-found="true"/> - - <!-- START SNIPPET: e3 --> - <!-- declare a camel context that scans for classes that is RouteBuilder - in the package org.apache.camel.example.server --> - <camel:camelContext id="camel-server"> - <camel:package>org.apache.camel.example.server</camel:package> - </camel:camelContext> - <!-- END SNIPPET: e3 --> - - <!-- START SNIPPET: e4 --> - <!-- lets configure the ActiveMQ JMS broker server --> - <broker:broker useJmx="false" persistent="false" brokerName="myBroker"> - <broker:transportConnectors> - <!-- expose a VM transport for in-JVM transport between AMQ and Camel on the server side --> - <broker:transportConnector name="vm" uri="vm://myBroker"/> - <!-- expose a TCP transport for clients to use --> - <broker:transportConnector name="tcp" uri="tcp://localhost:${tcp.port}"/> - </broker:transportConnectors> - </broker:broker> - <!-- END SNIPPET: e4 --> - - <!-- START SNIPPET: e5 --> - <!-- lets configure the Camel ActiveMQ to use the embedded ActiveMQ broker declared above --> - <bean id="jms" class="org.apache.camel.component.activemq.ActiveMQComponent"> - <property name="connectionFactory"> - <bean class="org.apache.activemq.spring.ActiveMQConnectionFactory"> - <property name="brokerURL" value="vm://myBroker"/> - <property name="trustAllPackages" value="true"/> - </bean> - </property> - </bean> - <!-- END SNIPPET: e5 --> - -</beans> diff --git a/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml b/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml deleted file mode 100644 index a94fc9d..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?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. - ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <!-- spring property placeholder, ignore resource not found as the file resource is for unit testing --> - <context:property-placeholder location="classpath:camel.properties,file:target/custom.properties" - ignore-resource-not-found="true"/> - - <camel:camelContext id="camel-client-2"> - <camel:template id="camelTemplate"/> - <!-- START SNIPPET: e1 --> - <!-- Camel proxy for a given service, in this case the JMS queue --> - <camel:proxy - id="multiplierProxy" - serviceInterface="org.apache.camel.example.server.Multiplier" - serviceUrl="jms:queue:numbers"/> - <!-- END SNIPPET: e1 --> - </camel:camelContext> - - <!-- Camel JMSProducer to be able to send messages to a remote Active MQ server --> - <bean id="jms" class="org.apache.camel.component.activemq.ActiveMQComponent"> - <property name="connectionFactory"> - <bean class="org.apache.activemq.spring.ActiveMQConnectionFactory"> - <property name="brokerURL" value="tcp://localhost:${tcp.port}"/> - <property name="trustAllPackages" value="true"/> - </bean> - </property> - </bean> - -</beans> diff --git a/examples/camel-example-spring-jms/src/main/resources/camel-client.xml b/examples/camel-example-spring-jms/src/main/resources/camel-client.xml deleted file mode 100644 index 0bedcd3..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/camel-client.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?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. - ---> -<!-- START SNIPPET: e1 --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:camel="http://camel.apache.org/schema/spring" - xmlns:context="http://www.springframework.org/schema/context" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - <!-- END SNIPPET: e1 --> - - <!-- START SNIPPET: e2 --> - <camel:camelContext id="camel-client"> - <camel:template id="camelTemplate"/> - </camel:camelContext> - <!-- END SNIPPET: e2 --> - - <!-- spring property placeholder, ignore resource not found as the file resource is for unit testing --> - <context:property-placeholder location="classpath:camel.properties,file:target/custom.properties" - ignore-resource-not-found="true"/> - - <!-- START SNIPPET: e3 --> - <!-- Camel JMSProducer to be able to send messages to a remote Active MQ server --> - <bean id="jms" class="org.apache.camel.component.activemq.ActiveMQComponent"> - <property name="connectionFactory"> - <bean class="org.apache.activemq.spring.ActiveMQConnectionFactory"> - <property name="brokerURL" value="tcp://localhost:${tcp.port}"/> - <property name="trustAllPackages" value="true"/> - </bean> - </property> - </bean> - <!-- END SNIPPET: e3 --> - -</beans> diff --git a/examples/camel-example-spring-jms/src/main/resources/camel.properties b/examples/camel-example-spring-jms/src/main/resources/camel.properties deleted file mode 100644 index f8510e2..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/camel.properties +++ /dev/null @@ -1,19 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -# properties for the application -tcp.port=61610 diff --git a/examples/camel-example-spring-jms/src/main/resources/log4j2.properties b/examples/camel-example-spring-jms/src/main/resources/log4j2.properties deleted file mode 100644 index f02e7ae..0000000 --- a/examples/camel-example-spring-jms/src/main/resources/log4j2.properties +++ /dev/null @@ -1,23 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -appender.stdout.type = Console -appender.stdout.name = stdout -appender.stdout.layout.type = PatternLayout -appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -rootLogger.level = INFO -rootLogger.appenderRef.stdout.ref = stdout diff --git a/examples/camel-example-spring-jms/src/test/java/org/apache/camel/example/SpringJmsClientRemotingServerTest.java b/examples/camel-example-spring-jms/src/test/java/org/apache/camel/example/SpringJmsClientRemotingServerTest.java deleted file mode 100644 index 3e417ee..0000000 --- a/examples/camel-example-spring-jms/src/test/java/org/apache/camel/example/SpringJmsClientRemotingServerTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 org.apache.camel.example; - -import java.io.File; -import java.io.FileOutputStream; - -import org.apache.camel.example.server.Multiplier; -import org.apache.camel.test.AvailablePortFinder; -import org.apache.camel.test.junit4.TestSupport; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class SpringJmsClientRemotingServerTest extends TestSupport { - - private static ClassPathXmlApplicationContext appCtx; - - @BeforeClass - public static void setupFreePort() throws Exception { - // find a free port number, and write that in the custom.properties file - // which we will use for the unit tests, to avoid port number in use problems - int port = AvailablePortFinder.getNextAvailable(); - String bank1 = "tcp.port=" + port; - - File custom = new File("target/custom.properties"); - FileOutputStream fos = new FileOutputStream(custom); - fos.write(bank1.getBytes()); - fos.close(); - - appCtx = new ClassPathXmlApplicationContext("/META-INF/spring/camel-server.xml", "camel-client-remoting.xml"); - appCtx.start(); - } - - @AfterClass - public static void stopSpring() { - appCtx.stop(); - } - - @Test - public void testCamelRemotingInvocation() { - // just get the proxy to the service and we as the client can use the "proxy" as it was - // a local object we are invoking. Camel will under the covers do the remote communication - // to the remote ActiveMQ server and fetch the response. - Multiplier multiplier = appCtx.getBean("multiplierProxy", Multiplier.class); - - int response = multiplier.multiply(33); - assertEquals("Get a wrong response", 99, response); - } - -} diff --git a/examples/camel-example-spring-jms/src/test/java/org/apache/camel/example/SpringJmsClientServerTest.java b/examples/camel-example-spring-jms/src/test/java/org/apache/camel/example/SpringJmsClientServerTest.java deleted file mode 100644 index 13bf877..0000000 --- a/examples/camel-example-spring-jms/src/test/java/org/apache/camel/example/SpringJmsClientServerTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 org.apache.camel.example; - -import java.io.File; -import java.io.FileOutputStream; - -import org.apache.camel.Endpoint; -import org.apache.camel.Exchange; -import org.apache.camel.ExchangePattern; -import org.apache.camel.Producer; -import org.apache.camel.test.AvailablePortFinder; -import org.apache.camel.test.spring.CamelSpringTestSupport; -import org.junit.BeforeClass; -import org.junit.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -public class SpringJmsClientServerTest extends CamelSpringTestSupport { - - @BeforeClass - public static void setupFreePort() throws Exception { - // find a free port number, and write that in the custom.properties file - // which we will use for the unit tests, to avoid port number in use problems - int port = AvailablePortFinder.getNextAvailable(); - String bank1 = "tcp.port=" + port; - - File custom = new File("target/custom.properties"); - FileOutputStream fos = new FileOutputStream(custom); - fos.write(bank1.getBytes()); - fos.close(); - } - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("/META-INF/spring/camel-server.xml"); - } - - @Test - public void testCamelClientInvocation() { - // as opposed to the CamelClientRemoting example we need to define the service URI in this java code - int response = template.requestBody("jms:queue:numbers", 22, Integer.class); - assertEquals("Get a wrong response", 66, response); - } - - @Test - public void testCamelEndpointInvocation() throws Exception { - // get the endpoint from the camel context - Endpoint endpoint = context.getEndpoint("jms:queue:numbers"); - - // create the exchange used for the communication - // we use the in out pattern for a synchronized exchange where we expect a response - Exchange exchange = endpoint.createExchange(ExchangePattern.InOut); - // set the input on the in body - // must you correct type to match the expected type of an Integer object - exchange.getIn().setBody(11); - - // to send the exchange we need an producer to do it for us - Producer producer = endpoint.createProducer(); - // start the producer so it can operate - producer.start(); - - // let the producer process the exchange where it does all the work in this one line of code - producer.process(exchange); - - // get the response from the out body and cast it to an integer - int response = exchange.getOut().getBody(Integer.class); - - assertEquals("Get a wrong response.", 33, response); - - // stop the producer after usage - producer.stop(); - } - -} diff --git a/examples/camel-example-spring-pulsar/pom.xml b/examples/camel-example-spring-pulsar/pom.xml index b4b53ca..de718a2 100644 --- a/examples/camel-example-spring-pulsar/pom.xml +++ b/examples/camel-example-spring-pulsar/pom.xml @@ -60,6 +60,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-pulsar</artifactId> </dependency> <dependency> diff --git a/examples/camel-example-spring-security/pom.xml b/examples/camel-example-spring-security/pom.xml index a01d101..38ac078 100644 --- a/examples/camel-example-spring-security/pom.xml +++ b/examples/camel-example-spring-security/pom.xml @@ -52,7 +52,7 @@ <dependencies> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-spring-ws/pom.xml b/examples/camel-example-spring-ws/pom.xml index d4cefe6..eaa8b2a 100644 --- a/examples/camel-example-spring-ws/pom.xml +++ b/examples/camel-example-spring-ws/pom.xml @@ -62,7 +62,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <!-- for running inside a servlet container --> diff --git a/examples/camel-example-spring-xquery/pom.xml b/examples/camel-example-spring-xquery/pom.xml index fed0ae5..de7d42f 100644 --- a/examples/camel-example-spring-xquery/pom.xml +++ b/examples/camel-example-spring-xquery/pom.xml @@ -55,6 +55,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-spring/pom.xml b/examples/camel-example-spring/pom.xml index acb33df..fe58167 100644 --- a/examples/camel-example-spring/pom.xml +++ b/examples/camel-example-spring/pom.xml @@ -65,6 +65,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <dependency> <groupId>org.apache.activemq</groupId> diff --git a/examples/camel-example-transformer-demo/pom.xml b/examples/camel-example-transformer-demo/pom.xml index a6a0bb0..fdfe0b1 100644 --- a/examples/camel-example-transformer-demo/pom.xml +++ b/examples/camel-example-transformer-demo/pom.xml @@ -58,7 +58,7 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> - <artifactId>camel-spring</artifactId> + <artifactId>camel-spring-xml</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/camel-example-widget-gadget-java/pom.xml b/examples/camel-example-widget-gadget-java/pom.xml index a4a1aa1..2ddb952 100644 --- a/examples/camel-example-widget-gadget-java/pom.xml +++ b/examples/camel-example-widget-gadget-java/pom.xml @@ -57,6 +57,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-main</artifactId> + </dependency> <!-- camel jms and activemq --> <dependency> diff --git a/examples/camel-example-widget-gadget-xml/pom.xml b/examples/camel-example-widget-gadget-xml/pom.xml index 8987ac6..56a87c1 100644 --- a/examples/camel-example-widget-gadget-xml/pom.xml +++ b/examples/camel-example-widget-gadget-xml/pom.xml @@ -62,6 +62,10 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-spring-main</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-xml</artifactId> + </dependency> <!-- camel jms and activemq --> <dependency> diff --git a/examples/pom.xml b/examples/pom.xml index 2daac3f..2d06937 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -151,7 +151,6 @@ <module>camel-example-splunk</module> <module>camel-example-spring</module> <module>camel-example-spring-javaconfig</module> - <module>camel-example-spring-jms</module> <module>camel-example-spring-pulsar</module> <module>camel-example-spring-ws</module> <module>camel-example-spring-xquery</module>