You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JackOfAllTrades <Ha...@yahoo.com> on 2019/10/17 15:39:55 UTC

AMQ CPP - How do you set up multiple destination for one producer

There is example code here in Java for multiple queues for one
session(producer)
https://stackoverflow.com/questions/43537444/activemq-producer-multiple-queues-one-session

Is there a way to do this for CPP?  
I've basically tried to replicate the functionality with AMQ CMS but when I
use the send command and change the queue from "oldQueue" to "newQueue", I
receive an error message:

This producer can only send messages to "oldQueue";

virtual void cms::MessageProducer::send(const Destination *destination,
		Message *  	message ) 	

basic code flow without actually typing in the code is:
Create new Factory
Set broker URI
Create Connection
Connection start
Create Session
Create Message Producer with a temp queue
Create a new queue
use session to create message
Message Producer send using new queue and message;

Appreciate any help,
S~




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: AMQ CPP - How do you set up multiple destination for one producer

Posted by Timothy Bish <ta...@gmail.com>.
On 10/18/19 8:00 AM, JackOfAllTrades wrote:
> Answering my own question....again....
>
> So basically, just create the producer without initializing with a
> queue(temporary or otherwise).  This seems to be different behavior from CMS
> then of JMS

Since you don't provide your code it is unclear what exactly you did but 
from the sounds of it that is behavior of both JMS and CMS.  A JMS 
MessageProducer that is created with a destination instead of null as 
the arg would be tied to that destination for its lifetime.

    Fixed destination = session.createProducer(myQueue);

    Anonymous producer = session.createProducer(null);


>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

-- 
Tim Bish


Re: AMQ CPP - How do you set up multiple destination for one producer

Posted by JackOfAllTrades <Ha...@yahoo.com>.
Answering my own question....again....

So basically, just create the producer without initializing with a
queue(temporary or otherwise).  This seems to be different behavior from CMS
then of JMS 



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html