Created
October 8, 2013 08:13
ToConsole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package camel.example.hello; | |
import java.util.Date; | |
import org.apache.camel.ProducerTemplate; | |
import org.apache.camel.spring.Main; | |
public class ToConsole { | |
public static void main(String[] args) throws Exception { | |
String ctxPath = "camel/example/hello/ToConsole.xml"; | |
Main main = new Main(); | |
main.setApplicationContextUri(ctxPath); | |
// Camel 컨텍스트 실행 | |
main.start(); | |
// Camel 생산자(발신자) 객체 획득 | |
ProducerTemplate producer = main.getCamelTemplate(); | |
// 메시지 발신 | |
producer.requestBody("direct:start", "Hello World! at " + new Date()); | |
// Camel 컨텍스트 종료 | |
main.stop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment