#143 Work on the example code
This commit is contained in:
		@@ -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();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user