Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 39947 invoked from network); 7 Jul 2009 17:26:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Jul 2009 17:26:03 -0000 Received: (qmail 86575 invoked by uid 500); 7 Jul 2009 17:26:13 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 86551 invoked by uid 500); 7 Jul 2009 17:26:13 -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 86541 invoked by uid 99); 7 Jul 2009 17:26:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jul 2009 17:26:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Tue, 07 Jul 2009 17:26:02 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MOEQG-0005S4-Vw for users@activemq.apache.org; Tue, 07 Jul 2009 10:25:40 -0700 Message-ID: <24377779.post@talk.nabble.com> Date: Tue, 7 Jul 2009 10:25:40 -0700 (PDT) From: shaldar To: users@activemq.apache.org Subject: Re: activemq-cpp client heartbeat and reconnect with broker? In-Reply-To: <5eda8340906251009occfb5c1l336b57ce53027df1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: shaltrade@gmail.com References: <24157918.post@talk.nabble.com> <5eda8340906230805l7c3df6c8ia7c309df5f9c1004@mail.gmail.com> <24187651.post@talk.nabble.com> <5eda8340906241149h4223e124q8f596e4277010a05@mail.gmail.com> <24196578.post@talk.nabble.com> <5eda8340906251009occfb5c1l336b57ce53027df1@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks Chetan - Looking at the tickets it looks like that is yet to be implemented. Where is the java client located? I can take a shot at porting it over. Otherwise I shall just work with a producer that sends ACK messages ocassionally. Also - I have implemeted JAAS simple authentication on the broker - so subscribers won't be able to send messages to the topic. So if a producer (with a subscriber's userid) tries to send and gets an authentication failed message, the subscriber knows that the broker is still reachable. If it gets any other message we know that the broker connection is compromised. Any flaws with the idea? Thanks - Susmit Chetan Sarva-2 wrote: > > I believe it should silently reconnect if it detects that the broker went > away. You may also want to see this ticket for your specific case: > > https://issues.apache.org/activemq/browse/AMQCPP-246 > > On Wed, Jun 24, 2009 at 11:56 PM, shaldar wrote: > >> >> Hi Chetan - I tested with 3.0 as you suggested. I built and used the >> SimpleAsyncConsumer.cpp example that comes with 3.0. It's connecting and >> receiving messages from the remote broker. >> >> However, changing the brokerURI to >> failover://(tcp://207.153.194.152:61616 >> ) >> or failover://(tcp://207.153.194.152:61616?maxInactivityDuration=1000) >> doesn't seem to have any effect when I pull off the internet connection. >> >> Is there a specific Exception I should be catching in the consumer when >> the >> KeepAlives fail? There is an exception listener in the code but that >> doesn't >> fire when KeepAlives should be failing. >> >> Best - Susmit >> >> >> Chetan Sarva-2 wrote: >> > >> > 3.0 now requires that you initialize the library before using it. >> Simply >> > call: >> > >> > activemq::library::ActiveMQCPP::initializeLibrary(); >> > >> > and clean it up with: >> > >> > activemq::library::ActiveMQCPP::shutdownLibrary(); >> > >> > no other code changes are required. You can simply use a broker URI >> with >> > failover like: >> > >> > failover://(tcp://localhost:61616) >> > >> > chetan >> > >> > On Wed, Jun 24, 2009 at 12:24 PM, shaldar wrote: >> > >> >> >> >> Thanks chetan - I am using 2.2.6 . I tried changing to 3.0 but it gave >> me >> >> a >> >> runtime error. To save time, I changed my links back to 2.2.6. >> >> >> >> In any case - 2.2.6 has a bunch of code related to >> maxInactivityDuration >> >> and >> >> KeepAliveInfo in the activemq::connector::openwire::commands >> namespace. >> >> >> >> If this feature is indeed there - what is the best way to access it? I >> >> have >> >> been using the cms::connection which pretty much ignores extensions to >> >> the >> >> brokerURI. Is there a different namespace I should go to for more >> >> features? >> >> Any sample code will be helpful. >> >> >> >> Best - Susmit >> >> >> >> >> >> Chetan Sarva-2 wrote: >> >> > >> >> > Which version of the library are you using? The latest version, 3.0, >> >> which >> >> > was released less than 2 weeks ago, supports the failover transport >> for >> >> > handling scenarios like this. >> >> > >> >> > chetan >> >> > >> >> > On Mon, Jun 22, 2009 at 8:22 PM, shaldar >> wrote: >> >> > >> >> >> >> >> >> Hi all - >> >> >> >> >> >> I wrote a publish/subscribe clients that seem to be working well >> with >> >> the >> >> >> broker. I want make the clients more reliable - particularly when >> the >> >> >> network connection goes down. This is especially needed for the >> >> >> subscriber, >> >> >> which just sits on an asynchronous listener once the connection >> >> starts. >> >> >> >> >> >> Is there anything simple I can do in my main loop that checks for >> the >> >> >> health >> >> >> of the connection to the broker? >> >> >> >> >> >> Also, if the connection goes down, should I just attempt to restart >> >> the >> >> >> connection - or - do I have to recreate new connection, session and >> >> >> consumer >> >> >> objects? >> >> >> >> >> >> Any ideas or sample codes will be very helpful. >> >> >> >> >> >> Best - Susmit >> >> >> >> >> >> -- >> >> >> View this message in context: >> >> >> >> >> >> http://www.nabble.com/activemq-cpp-client-heartbeat-and-reconnect-with-broker--tp24157918p24157918.html >> >> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/activemq-cpp-client-heartbeat-and-reconnect-with-broker--tp24157918p24187651.html >> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/activemq-cpp-client-heartbeat-and-reconnect-with-broker--tp24157918p24196578.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/activemq-cpp-client-heartbeat-and-reconnect-with-broker--tp24157918p24377779.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.