context = camelApp.getContext();
template = context.createProducerTemplate();
// Force hostname to be "localhost" for testing purposes
final DefaultManagementNamingStrategy naming = (DefaultManagementNamingStrategy) context.getManagementStrategy().getManagementNamingStrategy();
naming.setHostName("localhost");
naming.setDomainName("org.apache.camel");
// setup the ManagementAgent to include the hostname
context.getManagementStrategy().getManagementAgent().setIncludeHostName(true);
camelApp.start();