X Tutup
Skip to content

Commit acd7070

Browse files
committed
iluwatar#143 Work on the example code
1 parent cd4d420 commit acd7070

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

message-channel/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<groupId>org.apache.camel</groupId>
1515
<artifactId>camel-core</artifactId>
1616
</dependency>
17+
<dependency>
18+
<groupId>org.apache.camel</groupId>
19+
<artifactId>camel-stream</artifactId>
20+
</dependency>
1721
<dependency>
1822
<groupId>junit</groupId>
1923
<artifactId>junit</artifactId>
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
package com.iluwatar.message.channel;
22

33
import org.apache.camel.CamelContext;
4+
import org.apache.camel.ProducerTemplate;
5+
import org.apache.camel.builder.RouteBuilder;
46
import org.apache.camel.impl.DefaultCamelContext;
57

68
public class App {
79

810
public static void main(String[] args) throws Exception {
911
CamelContext context = new DefaultCamelContext();
12+
13+
context.addRoutes(new RouteBuilder() {
14+
15+
@Override
16+
public void configure() throws Exception {
17+
from("direct:greetings").to("stream:out");
18+
}
19+
});
20+
1021
context.start();
11-
Thread.sleep(10000);
22+
ProducerTemplate template = context.createProducerTemplate();
23+
template.sendBody("direct:greetings", "jou man");
24+
Thread.sleep(1000);
1225
context.stop();
1326
}
1427
}

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
<artifactId>camel-core</artifactId>
112112
<version>${camel.version}</version>
113113
</dependency>
114+
<dependency>
115+
<groupId>org.apache.camel</groupId>
116+
<artifactId>camel-stream</artifactId>
117+
<version>${camel.version}</version>
118+
</dependency>
114119
<dependency>
115120
<groupId>junit</groupId>
116121
<artifactId>junit</artifactId>

0 commit comments

Comments
 (0)
X Tutup