THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
It can be configured with a default endpoint if you just want to send lots of messages to the same endpoint; or you can specify an Endpoint or URI uri as the first parameter.
The sendBody() method allows you to send any object to an endpoint easily.
Code Block |
---|
ProducerTemplate template; // send to default endpoint template.sendBody("<hello>world!</hello>"); // send to a specific queue template.sendBody("activemq:MyQueue", "<hello>world!</hello>"); // send with a body and header template.sendBodyAndHeader("activemq:MyQueue", "CustomerRating<hello>world!</hello>", "GoldCustomerRating", "<hello>world!</hello>Gold"); |
You can also supply an Exchange or a Processor to customize the exchange
...