In a question and response here:
ActiveMQ Producer Multiple Queues One Session
The topic of a single producer sending messages to more them one destination is covered with a solution in Java.
Can the same thing in CPP/CMS be done?
I've tried to replicate that code using cms/activemq API but when I try to send a message to a different queue(destination), I receive error messages stating the producer can only send to the old destination.
Without writing the exact code here is the flow...
- Create new Factory
- Set broker URI
- Create Connection
- Connection start
- Create Session
- Create MessageProducer with a temporary queue
- Create a new queue
- Use session to create message
- MessageProducer send using new queue and message