#143 Work on the example code
This commit is contained in:
parent
cd4d420376
commit
acd7070831
@ -14,6 +14,10 @@
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-stream</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
|
@ -1,14 +1,27 @@
|
||||
package com.iluwatar.message.channel;
|
||||
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.ProducerTemplate;
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.apache.camel.impl.DefaultCamelContext;
|
||||
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
CamelContext context = new DefaultCamelContext();
|
||||
|
||||
context.addRoutes(new RouteBuilder() {
|
||||
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
from("direct:greetings").to("stream:out");
|
||||
}
|
||||
});
|
||||
|
||||
context.start();
|
||||
Thread.sleep(10000);
|
||||
ProducerTemplate template = context.createProducerTemplate();
|
||||
template.sendBody("direct:greetings", "jou man");
|
||||
Thread.sleep(1000);
|
||||
context.stop();
|
||||
}
|
||||
}
|
||||
|
5
pom.xml
5
pom.xml
@ -111,6 +111,11 @@
|
||||
<artifactId>camel-core</artifactId>
|
||||
<version>${camel.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-stream</artifactId>
|
||||
<version>${camel.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user