activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Teira <>
Subject AMQ 4.1.1 and TransportConnector brokerName
Date Wed, 06 Jun 2007 15:30:45 GMT

My aim is to be able to have different clusters (JDBC master-slave) 
running in the same local network. I also want to be able to discover 
the running nodes from the clients, and so I was using a discoverUri 
(multicast://default) in the TransportConnector and the proper 
configuration for the clients. But to be able to isolate the different 
clusters, I think that I need to use different discoveryUris.

The first question is about the meaning of that uri multicast://default. 
Is that the same than using:

public static final String 


I've also seen that there's a property in the MulticastDiscoveryAgent 
called group. Its default value is 'default', is that related with the 
'default' token in the URI?

I wonder if URIs like multicast://<token> using different tokens for the 
different clusters should be enough to discriminate them. This is 
related with the following question:

Looking at the source code, it seems that the multicast code  is using 
the brokerName of the TransportConnector to be able to discriminate 
different clusters, as the packet payload has something like:

           String payload=getType();

in org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent

But while starting; I get a warning that seems to be written from 

            if (brokerName == null || brokerName.length()==0){
                log.warn("brokerName not set");

Looking a little more in the code, it seems that the brokerName should 
be set by, before starting 
the DiscoveryAgent, its start() method says:

        if( da!=null ) {

So, the brokerName is the one in the BrokerInfo private instance of the 
TransportConnector, that is set using 
TransportConnector.setBrokername(String brokerName)

This is what I have in the xml configuration file:

<transportConnector brokerName="test" name="default" 
uri="tcp://localhost:61625" discoveryUri="multicast://"/>

In the activeMQ log, I see how spring is aware of the brokerName 
property, and it seems to set it:

Caching PropertyDescriptors for class 

Found bean property 'brokerName' of type [java.lang.String]

15:37:25,748][main][org.springframework.beans.BeanWrapperImpl] About to 
invoke write method [public void] 
on object of class []
15:37:25,748][main][org.springframework.beans.BeanWrapperImpl] Invoked 
write method [public void] 
with value of type [java.lang.String]

But, anyway, I'm getting multiple warnings like this:

[WARN ][2007-06-06 

brokerName not set

Perhaps they are from different MulticastDiscoveryAgents than the one 
bound to the TransportConnector?

So, please. Could you explain or direct me to some information source 
where I could learn how to write a proper multicast URI, and what is the 
meaning of its fields?

Thanks a lot.

View raw message