Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 82255 invoked from network); 25 Oct 2007 06:49:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Oct 2007 06:49:08 -0000 Received: (qmail 44730 invoked by uid 500); 25 Oct 2007 06:48:54 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 44702 invoked by uid 500); 25 Oct 2007 06:48:54 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 44688 invoked by uid 99); 25 Oct 2007 06:48:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Oct 2007 23:48:54 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 06:48:57 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IkwWC-0001EO-SA for users@activemq.apache.org; Wed, 24 Oct 2007 23:48:36 -0700 Message-ID: <13401180.post@talk.nabble.com> Date: Wed, 24 Oct 2007 23:48:36 -0700 (PDT) From: Scott the Red To: users@activemq.apache.org Subject: c++ client doesn't receive on all topic consumers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: scott_samek@yahoo.com X-Virus-Checked: Checked by ClamAV on apache.org I'm creating a C++ adapter class to represent a message consumer connecting to ActiveMQ. Unfortunately, the consumers are not reliably receiving messages. Some receive OK, but others have a problem where the first consumer of a particular message doesn't receive. However, any additional consumers of the same type do. I also see that a process sending a message in one thread won't receive the message in another thread. The sender and consumer use different connections, and the consumer's "noLocal" is false. The consumers are listening on topics using message selectors. The topics and connection have no special configuration. The adapter is based on the "standard" example at http://activemq.apache.org/cms/example.html The connection code looks like this (mostly it's just a copy of the example): void MyConsumer::start() { std::string brokerURI = "tcp://127.0.0.1:61616" "?wireFormat=openwire" "&transport.useAsyncSend=true"; // Create a ConnectionFactory ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory( brokerURI ); // Create a Connection connection = connectionFactory->createConnection(); delete connectionFactory; connection->start(); connection->setExceptionListener(this); // Create a Session session = connection->createSession( Session::AUTO_ACKNOWLEDGE ); // Create the destination (Topic or Queue) if( useTopic ) { destination = session->createTopic( this->destinationName ); } else { destination = session->createQueue( this->destinationName ); } // create a message selector: std::stringstream selector; selector << "messageType='" << this->messageType << "'"; // Create a MessageConsumer from the Session to the Topic or Queue consumer = session->createConsumer( destination, selector.str() ); consumer->setMessageListener( this ); // Indicate we are ready for messages. latch.countDown(); } /*virtual*/ void onMessage( const Message* message ) { ... } Debugging and output show that onMessage() is never called for the non-receiving consumers. Java-based processes show that the input messages are being sent correctly. Anyone have any ideas? Is there a way to configure the topic for higher reliability? Thanks! -- View this message in context: http://www.nabble.com/c%2B%2B-client-doesn%27t-receive-on-all-topic-consumers-tf4688946s2354.html#a13401180 Sent from the ActiveMQ - User mailing list archive at Nabble.com.