From users-return-13836-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Thu May 01 18:01:04 2008 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 68870 invoked from network); 1 May 2008 18:01:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 May 2008 18:01:04 -0000 Received: (qmail 4121 invoked by uid 500); 1 May 2008 18:01:05 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 4088 invoked by uid 500); 1 May 2008 18:01:04 -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 4077 invoked by uid 99); 1 May 2008 18:01:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 11:01:04 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [71.74.56.122] (HELO hrndva-omtalb.mail.rr.com) (71.74.56.122) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 18:00:09 +0000 Received: from DIEGO ([97.76.56.102]) by hrndva-omta03.mail.rr.com with ESMTP id <20080501180026.VLKN16750.hrndva-omta03.mail.rr.com@DIEGO> for ; Thu, 1 May 2008 18:00:26 +0000 From: "Joe Fernandez" To: Subject: RE: Help with embedded brokers Date: Thu, 1 May 2008 14:00:00 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: Thread-Index: Acirs80vIaA09cjPQ8yw5FxKfl9cOwAAUHfA Message-Id: <20080501180026.VLKN16750.hrndva-omta03.mail.rr.com@DIEGO> X-Virus-Checked: Checked by ClamAV on apache.org You can't have both brokers connect to each other with duplex connections. Joe -----Original Message----- From: matt hoffman [mailto:matt@mhoffman.org] Sent: Thursday, May 01, 2008 1:50 PM To: users@activemq.apache.org Subject: Re: Help with embedded brokers Ok, I gave that a shot. I set the broker name to a randomly-generated UUID (which has implications for durable subscriptions and data recovery should a broker go down, I imagine, but it's for the sake of testing). I still got errors, so I set the network connector name to the same value. It made the error a lot messier to look at, but it's actually the same error: In this case, I started broker "be052f4d-5d66-4b61-bfb0-a298f72f8a27" first, then broker "81ca000d-ad12-4afe-9f94-733930ff7d54". Here's the error that was displayed on the second broker's side: javax.jms.InvalidClientIDException: Broker: 81ca000d-ad12-4afe-9f94-733930ff7d54 - Client: NC_be052f4d-5d66-4b61-bfb0-a298f72f8a27_outbound already connected from vm://81ca000d-ad12-4afe-9f94-733930ff7d54#0 The error on the first broker's side is similar, but with the broker names reversed: javax.jms.InvalidClientIDException: Broker: be052f4d-5d66-4b61-bfb0-a298f72f8a27 - Client: NC_81ca000d-ad12-4afe-9f94-733930ff7d54_outbound already connected from vm://be052f4d-5d66-4b61-bfb0-a298f72f8a27#2 Surely, I must be doing something wrong here? On Thu, May 1, 2008 at 1:09 PM, Dejan Bosanac wrote: > Hi, > > you can try specifying different name for every broker. It should help. > > Regards > -- > Dejan Bosanac > www.scriptinginjava.net > On Thu, May 1, 2008 at 5:29 PM, matt hoffman wrote: > > > I'm having a lot of trouble getting embedded brokers to work as they > > should. I'm using them in my case mainly to ease configuration -- I > want > > to > > be able to run several instances of the same code and have them discover > > each other and communicate, without needing a single server already > > running. > > > > > > The current problem is, the first server starts up great, and works as > > expected. Subsequent servers, though, throw this error: > > > > javax.jms.InvalidClientIDException: Broker: localhost - Client: > > NC_localhost_inboundlocalhost already connected from vm://localhost#0 > > > > Which seems strange, seeing as how I'm not explicitly setting clientID > > anywhere. I thought these were auto-generated? > > > > Below is the configuration I'm currently using. I'm not referencing the > > broker in code at all; I'm interacting with it only through the Spring > > JmsTemplate, which in turn gets a connection from the > > ActiveMQConnectionFactory connecting to vm://localhost. Based on the > > documentation, that seems to be the way to do it... what have I > > misunderstood? > > > > > > In my Spring config: > > > > class="org.apache.activemq.xbean.BrokerFactoryBean"> > > > > > > > > > > > class="org.apache.activemq.command.ActiveMQQueue"> > > > > > > > > > class="org.apache.activemq.command.ActiveMQTopic"> > > > > > > > > > class="org.apache.activemq.ActiveMQConnectionFactory" > depends-on="broker"> > > > > > > > > > class="org.springframework.jms.core.JmsTemplate"> > > > > > > > class="org.springframework.jms.connection.CachingConnectionFactory"> > > > > > > > > > > > > > > > > > > > > I previously tried including the broker config directly in the Spring > > file, > > but broke it out as a problem-solving exercise and haven't moved it back > > yet. > > Here's the referenced activemq.xml: > > > > > > > xmlns:jms="http://activemq.org/config/1.0" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://www.springframework.org/schema/beans > > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd > > http://activemq.org/config/1.0 > > http://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd" > > default-lazy-init="false"> > > > > > > > > duplex="true"/> > > > > > > > > > > > > > > > > > > uri="tcp://localhost:0" > > discoveryUri="multicast://default"/> > > > > > > > > > > > > >