File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
src/main/java/com/iluwatar/message/channel Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 11package com .iluwatar .message .channel ;
22
33import org .apache .camel .CamelContext ;
4+ import org .apache .camel .ProducerTemplate ;
5+ import org .apache .camel .builder .RouteBuilder ;
46import org .apache .camel .impl .DefaultCamelContext ;
57
68public 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}
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments