Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA94310DA9 for ; Wed, 14 Aug 2013 19:05:31 +0000 (UTC) Received: (qmail 81964 invoked by uid 500); 14 Aug 2013 19:05:31 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 81842 invoked by uid 500); 14 Aug 2013 19:05:31 -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 81834 invoked by uid 99); 14 Aug 2013 19:05:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Aug 2013 19:05:30 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcjau-user-2@m.gmane.org designates 80.91.229.3 as permitted sender) Received: from [80.91.229.3] (HELO plane.gmane.org) (80.91.229.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Aug 2013 19:05:26 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V9gNT-0007jw-Rw for users@activemq.apache.org; Wed, 14 Aug 2013 21:05:03 +0200 Received: from c-68-32-133-231.hsd1.nj.comcast.net ([68.32.133.231]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Aug 2013 21:05:03 +0200 Received: from oleg.dulin by c-68-32-133-231.hsd1.nj.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Aug 2013 21:05:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: users@activemq.apache.org From: Oleg Dulin Subject: Re: Broker federation and messages not getting forwarded Date: Wed, 14 Aug 2013 15:03:36 -0400 Lines: 318 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-68-32-133-231.hsd1.nj.comcast.net User-Agent: Unison/2.1.10 X-Virus-Checked: Checked by ClamAV on apache.org One more note -- here is a kicker. If I change the consumers to producer's IP, comment out hte producer, and restart the program -- they get all their messages! This is driving me nuts! On 2013-08-14 18:59:55 +0000, Oleg Dulin said: > ----------------17595334911828795876 > > Content-Type: text/plain; charset=iso-8859-1; format=flowed > > Content-Transfer-Encoding: 8bit > > > > Dear Distinguished Colleagues: > > > > I have the following configuration. > > > > I have broker1 (7.107) set up as follows: > > > > > > > > > > > > My second broker (7.106) is setup like this: > > > > > > > > > > > > > uri="static:(tcp://192.168.7.107:3200)" > > duplex="true" /> > > > > > > Once in awhile, but consistently, the federation gets into a funny > > state where if consumers are on 106, but producer is on 107, 106 > > doesn't get any messages. > > > > Same happens if roducer is on 106, and consumers are on 107. > > > > If they are all on the same broker, either one, all is well. > > > > Once I restart the brokers, everything's fine for awhile, until it is > > not. Usually a moderate to heavy volume of messages is enough to get > > the system into this state. > > > > I am convinced it is either a misconfiguration on my part, or a bug in > > ActiveMQ. Hopefully, this is just a misconfiguration. > > > > Here is the test code. I change the IPs for both consumers and producer > > to test it out. > > > > public class FederationTest > > { > > public static void main(String args[]) throws JMSException, > > InterruptedException > > { > > ActiveMQConnectionFactory factory1 = new > > ActiveMQConnectionFactory("failover:(tcp://192.168.7.107:3200)"); > > factory1.setUseAsyncSend(true); > > initConsumer("c1",factory1); > > > > > > ActiveMQConnectionFactory factory2 = new > > ActiveMQConnectionFactory("failover:(tcp://192.168.7.106:3200)"); > > factory2.setUseAsyncSend(true); > > initConsumer("c2",factory2); > > > > > > ActiveMQConnectionFactory factory3 = new > > ActiveMQConnectionFactory("failover:(tcp://192.168.7.107:3200)"); > > factory3.setUseAsyncSend(true); > > initProducer(factory3); > > while(true) > > { > > Thread.sleep(1000); > > } > > > > } > > > > private static void initProducer(ActiveMQConnectionFactory factory) > > throws JMSException > > { > > QueueConnection queueConnection1=factory.createQueueConnection(); > > queueConnection1.start(); > > final QueueSession qs1=queueConnection1.createQueueSession(false, > > Session.AUTO_ACKNOWLEDGE); > > Queue q1=qs1.createQueue("TEST"); > > final QueueSender qSender=qs1.createSender(q1); > > new Thread(new Runnable() { > > > > @Override > > public void run() > > { > > int counter=0; > > while(true) > > { > > try > > { > > TextMessage msg=qs1.createTextMessage(); > > msg.setText("counter="+counter); > > System.out.println("p:"+counter); > > counter++; > > qSender.send(msg); > > > > Thread.sleep(1000); > > } > > catch(Exception exp) > > { > > exp.printStackTrace(); > > } > > > > } > > } > > > > }).start(); > > > > > > } > > > > public static void initConsumer(final String > > cname,ActiveMQConnectionFactory factory) throws JMSException > > { > > QueueConnection queueConnection1=factory.createQueueConnection(); > > queueConnection1.start(); > > QueueSession qs1=queueConnection1.createQueueSession(false, > > Session.AUTO_ACKNOWLEDGE); > > Queue q1=qs1.createQueue("TEST"); > > MessageConsumer c1=qs1.createConsumer(q1); > > c1.setMessageListener(new MessageListener() { > > @Override > > public void onMessage(Message msg) > > { > > try > > { > > TextMessage txt=(TextMessage) msg; > > System.out.println(cname+":"+txt.getText()); > > Thread.sleep((long) (1000*Math.random())); > > } > > catch(Exception exp) > > { > > exp.printStackTrace(); > > } > > } > > > > }); > > } > > } > > > > > > > > > > -- > > Regards, > > Oleg Dulin > > http://www.olegdulin.com > > ----------------17595334911828795876-- > > > > > > > -- Regards, Oleg Dulin http://www.olegdulin.com