You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by tpounds <tr...@gmail.com> on 2007/10/29 22:53:14 UTC

InvalidClientIDException when using valid NetworkConnectors in activemq.xml

I'm seeing a weird problem when using static network connectors in the latest
5.0 snapshots. If i specify the following in my activemq.xml. The following
happens when my local broker is running activemq 5.0 and the upstream
servers are using 4.1.1 or 5.0-SNAPSHOT.  I also see the issue when using
4.1.1 instances but the error message is less verbose than the one listed
below.

   <networkConncetors>
      <networkConncetor name="nc1" uri="static:(tcp://server1:61616)"/>
      <networkConncetor name="nc2" uri="static:(tcp://server2:61616)"/>
   </networkConncetors>

or

   <networkConncetors>
      <networkConncetor name="nc1"
uri="static:(tcp://server1:61616,tcp://server2:61616)"/>
   </networkConncetors>

I will see a pretty verbose stack trace with the following errors
(5.0-SNAPSHOT):

WARN TransportConnection - Failed to add Connection
javax.jms.InvalidClientIDException: Broker: localhost- Client:
NC_localhost_inboundlocalhost already connected from vm://localhost#0

a little bit further down I see the following

Async error occurred: javax.jms.InvalidClientIDException: Broker: localhost-
Client: NC_localhost_inboundlocalhost already connected from
vm://localhost#0

It continues to show this for a few times and then stops.  I haven't tested
to see if the connections between the upstream brokers is connected, so I'm
not sure if this is affecting any use cases. I will try to post back with
more information regarding this.

The 4.1.1 instance shows the following...it seems to be the same sort of
error.

INFO DemandForwardingBridge - Network connection between vm://localhost#2
and tcp://server2:61616 shutdown due to local error:
javax.jms.InvalidClientIDException: Broker: localhost- Client:
NC_localhost_inboundlocalhost already connected
-- 
View this message in context: http://www.nabble.com/InvalidClientIDException-when-using-valid-NetworkConnectors-in-activemq.xml-tf4714929s2354.html#a13477767
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: InvalidClientIDException when using valid NetworkConnectors in activemq.xml

Posted by tpounds <tr...@gmail.com>.
I've found a suitable workaround via system properties and command line.  For
anyone else interested this may be useful.

activemq.xml:
<broker xmlsns="http://...." brokerName="${system.hostname}
dataDirectory="${activemq.base}/data">

It can be run on *nix systems as follows.  I suspect there is a way to do
this on Windows with a bit of effort as well. 

command:
bin/activemq -Dsystem.hostname=`hostname`
-- 
View this message in context: http://www.nabble.com/InvalidClientIDException-when-using-valid-NetworkConnectors-in-activemq.xml-tf4714929s2354.html#a13492393
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: InvalidClientIDException when using valid NetworkConnectors in activemq.xml

Posted by Rob Davies <ra...@gmail.com>.
On Oct 29, 2007, at 11:25 PM, tpounds wrote:

>
> I found the root cause for this error...I found it burried in  
> another thread
> and seems to be the result of all the brokers having the same  
> default name
> set to "localhost".
>
> see:
> http://www.nabble.com/forum/ViewPost.jtp? 
> post=4426623&framed=y&skin=2354
>
> It may be beneficial to generate unique broker names by default if  
> they are
> not specified in the XML.  I see that the name currently defaults to
> localhost in both the xml file and the java source.  Should I raise  
> a JIRA
> ticket to improve this?

Generating a unique name for the broker would cause more problems  
than it cures - as the broker name is used to distinguish the  
directory structure for its local message store.
> -- 
> View this message in context: http://www.nabble.com/ 
> InvalidClientIDException-when-using-valid-NetworkConnectors-in- 
> activemq.xml-tf4714929s2354.html#a13479318
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: InvalidClientIDException when using valid NetworkConnectors in activemq.xml

Posted by tpounds <tr...@gmail.com>.
I found the root cause for this error...I found it burried in another thread
and seems to be the result of all the brokers having the same default name
set to "localhost".

see:
http://www.nabble.com/forum/ViewPost.jtp?post=4426623&framed=y&skin=2354

It may be beneficial to generate unique broker names by default if they are
not specified in the XML.  I see that the name currently defaults to
localhost in both the xml file and the java source.  Should I raise a JIRA
ticket to improve this?
-- 
View this message in context: http://www.nabble.com/InvalidClientIDException-when-using-valid-NetworkConnectors-in-activemq.xml-tf4714929s2354.html#a13479318
Sent from the ActiveMQ - User mailing list archive at Nabble.com.