in spring-pulsar/src/main/java/org/apache/camel/example/pulsar/client/CamelClient.java [39:52]
public static void main(final String[] args) throws Exception {
System.out.println("Notice this client requires that the CamelServer is already running!");
try (AbstractApplicationContext context = new ClassPathXmlApplicationContext("camel-client.xml")) {
// get the camel template for Spring template style sending of messages (= producer)
ProducerTemplate camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class);
for (int i=0; i<10;i++) {
int input = new Random().nextInt(100);
System.out.printf("Invoking the multiply with %d%n", input);
camelTemplate.sendBody(ENDPOINT_URI, ExchangePattern.InOnly, input);
}
}
}