Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 67338 invoked from network); 1 May 2008 17:57:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 May 2008 17:57:37 -0000 Received: (qmail 844 invoked by uid 500); 1 May 2008 17:57:38 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 813 invoked by uid 500); 1 May 2008 17:57:38 -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 802 invoked by uid 99); 1 May 2008 17:57:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 10:57:38 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [71.74.56.123] (HELO hrndva-omtalb.mail.rr.com) (71.74.56.123) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 17:56:50 +0000 Received: from DIEGO ([97.76.56.102]) by hrndva-omta04.mail.rr.com with ESMTP id <20080501175701.RHAC15730.hrndva-omta04.mail.rr.com@DIEGO> for ; Thu, 1 May 2008 17:57:01 +0000 From: "Joe Fernandez" To: Subject: RE: Help with embedded brokers Date: Thu, 1 May 2008 13:56:36 -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: Acirq/88YYtkIu0VRz++ptn+uQndUQABwy0w Message-Id: <20080501175701.RHAC15730.hrndva-omta04.mail.rr.com@DIEGO> X-Virus-Checked: Checked by ClamAV on apache.org What's happening is that you have two brokers with the same name trying to connect with one another. The exception throws people off because they always perceive it mean that it has something to do with their client, which is not always the case. Whenever you see the "NC_" prefix associated with this exception it reflects a local or remote bridge between two brokers. This is how the clientID is constructed if the broker was trying to set up a local bridge. localClientId = "NC_" + remoteBrokerName + "_inbound" + configuration.getBrokerName(); And this one if the broker was trying to set up a remote bridge. remoteConnectionInfo.setClientId("NC_" + configuration.getBrokerName() + "_outbound"); In your case, it is a local bridge, but the local and remote broker names are the same (i.e., localhost). Joe Goto www.ttmsolutions.com for a free ActiveMQ user guide -----Original Message----- From: matt hoffman [mailto:matt@mhoffman.org] Sent: Thursday, May 01, 2008 11:30 AM To: users@activemq.apache.org Subject: Help with embedded brokers 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: 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: