diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..6ceb844 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5372e92 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/release11/Main.java b/src/main/java/com/release11/Main.java index af9b711..10907d2 100644 --- a/src/main/java/com/release11/Main.java +++ b/src/main/java/com/release11/Main.java @@ -2,8 +2,10 @@ package com.release11; import com.mysql.cj.jdbc.MysqlDataSource; import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.command.ActiveMQMapMessage; import org.apache.camel.AggregationStrategy; import org.apache.camel.CamelContext; +import org.apache.camel.Expression; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.jms.JmsComponent; @@ -35,24 +37,24 @@ public class Main { connectionFactory.setPassword("admin"); context.addComponent("activemq", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); - - AggregationStrategy aggregationStrategy = new MyAggregation(); + //DAO dao = new DAO(); - DAO dao = new DAO(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { + from("direct:start").to("jdbc:source") .split(body()) - .bean(dao,"splitMaterial") .to("activemq:queue:material") - .to("log:?level=INFO&showHeaders=true&showBody=true"); + .to("log:?level=INFO&showBody=true"); from("activemq:queue:material") - .enrich("jdbc:source",aggregationStrategy) + .setBody(constant("SELECT * FROM package WHERE material_id = 1" + from("activemq:queue:material"))) + .to("jdbc:source") .to("activemq:queue:materialPackage") - .to("log:?level=INFO&showHeaders=true&showBody=true"); + .to("log:?level=INFO&showBody=true"); + } }); @@ -61,7 +63,7 @@ public class Main { template.sendBody("direct:start", "SELECT * FROM material LIMIT 1"); Thread.sleep(1000); - template.setDefaultEndpointUri("activemq:queue:material"); + //template.setDefaultEndpointUri("activemq:queue:material"); context.stop(); } diff --git a/src/main/java/com/release11/MyAggregation.java b/src/main/java/com/release11/MyAggregation.java deleted file mode 100644 index afc04d9..0000000 --- a/src/main/java/com/release11/MyAggregation.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.release11; - -import org.apache.camel.AggregationStrategy; -import org.apache.camel.Exchange; - -public class MyAggregation implements AggregationStrategy { - @Override - public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { - return oldExchange; - } -} diff --git a/target/classes/com/release11/Main$1.class b/target/classes/com/release11/Main$1.class index 02c6665..5233f0e 100644 Binary files a/target/classes/com/release11/Main$1.class and b/target/classes/com/release11/Main$1.class differ diff --git a/target/classes/com/release11/Main.class b/target/classes/com/release11/Main.class index 0f05702..28c8fdc 100644 Binary files a/target/classes/com/release11/Main.class and b/target/classes/com/release11/Main.class differ diff --git a/target/classes/com/release11/MyAggregation.class b/target/classes/com/release11/MyAggregation.class deleted file mode 100644 index 772be14..0000000 Binary files a/target/classes/com/release11/MyAggregation.class and /dev/null differ