On Wed, 2010-05-19 at 11:42 -0700, nathanmcdaniel wrote: > Hi All, > > Rather new to the JMS as a whole. I am using the ActiveMQ-CPP (3.1.2) client > to connect to the ActiveMQ server (5.3.2). > > I am receiving my own messages, and would like to stop! I am using code > extended from one of the examples > (http://activemq.apache.org/cms/example.html). > > I am using topics, and have tried a couple of different things. I've tried: > A) std::string noSelector; > consumer = session->createConsumer( destination, noSelector, true ); > > B) Using the noLocal uri addendum: > // Create the destination (Topic or Queue) > std::string channelWithOptions( this->m_channel ); > channelWithOptions += "?consumer.noLocal=true"; > if( useTopic ) { > destination = session->createTopic( channelWithOptions ); > } else { > destination = session->createQueue( channelWithOptions ); > } > > The only thought is that maybe because I'm not specifying the destination > when sending it doesn't know how to filter these messages? > producer->send( &msg ); > > > Any thoughts? > > Thank you, > > Nathan > >
If using the example code then I wouldn't expect the noLocal flag to do anything since the producer and consumer each create its own connection so in the view of the consumer, the messages produced aren't local. NoLocal only applies to messages sent from a Producer from the same Connection as the Consumer. Regards -- Tim Bish Open Source Integration: http://fusesource.com ActiveMQ in Action: http://www.manning.com/snyder/ Follow me on Twitter: http://twitter.com/tabish121 My Blog: http://timbish.blogspot.com/
