// START SNIPPET: e1
CamelContext context = new DefaultCamelContext();
// END SNIPPET: e1
// Set up the JMS broker and the CXF SOAP over JMS server
// START SNIPPET: e2
JmsBroker broker = new JmsBroker();
Server server = new Server();
try {
broker.start();
server.start();
// END SNIPPET: e2
// Add some configuration by hand ...
// START SNIPPET: e3
context.addRoutes(new RouteBuilder() {
public void configure() {
// Here we just pass the exception back , don't need to use errorHandler
errorHandler(noErrorHandler());
from(ROUTER_ENDPOINT_URI).to(SERVICE_ENDPOINT_URI);
}
});
// END SNIPPET: e3
// Starting the routing context
// Using the CXF Client to kick off the invocations
// START SNIPPET: e4
context.start();
Client client = new Client(ROUTER_ADDRESS + "?wsdl");
// END SNIPPET: e4
// Now everything is set up - let's start the context
client.invoke();
Thread.sleep(1000);
context.stop();
} catch (Exception ex) {
ex.printStackTrace();
} finally {
server.stop();
broker.stop();
System.exit(0);
}
}