activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurence <>
Subject Re: ActiveMQ spring xml configure connector publishedAddressPolicy
Date Wed, 10 Jul 2013 00:00:28 GMT
I still have not figured out how to xml configure a transportConnector
publishedAddressPolicy and publishedHostStrategy to a value of

I created a groovy script spring bean to assist with configuration and
it works for the uri attribute of the transportConnector, but have had
no luck setting publishedAddressPolicy ... tried all sorts of things
with and without using groovy.  

One thing I learned on my Scientific Linux 6.4 machine is that I have to
set the transportConnector uri to use the actual machine IP instead of
using and then I have to create another connector to
(that's why I created the groovy helper to guess which ip to use by
looking for a NIC that's on the same subnet as my wireless router). 

Here is one of my latest failed configuration attempts:

            <!-- DOS protection, limit concurrent connections to 1000 and frame size to
100MB -->
             <transportConnector name="openwire" uri="tcp://;wireformat.maxFrameSize=104857600"/>
             <transportConnector name="openwire2" uri="tcp://#{groovyConfigHelper1.guessIp}:61616?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"
					 <publishedAddressPolicy publishedHostStrategy="IPADDRESS" />

            <transportConnector name="amqp" uri="amqp://;wireformat.maxFrameSize=104857600"/>

Partial Error Message:
Attribute 'publishedHostStrategy' is not allowed to appear in element 'publishedAddressPolicy'.

I checked the xsd looking for some clues ...
and it appears publishedAddressPolicy is an element and publishedHostStrategy is an attribute
of type string.

<!-- element for type: -->
  <xs:element name='publishedAddressPolicy'>
        Policy object that controls how a TransportConnector publishes the connector's
address to the outside world.  By default the connector will publish itself
using the resolved host name of the bound server socket.
      <xs:attribute name='clusterClientUriQuery' type='xs:string'>
            Gets the URI query that's configured on the published URI that's sent to client's
when the cluster info is updated.
      <xs:attribute name='publishedHostStrategy' type='xs:string'/>
      <xs:attribute name='id' type='xs:ID'/>
      <xs:anyAttribute namespace='##other' processContents='lax'/>

My current less than ideal workaround until I completely figure out the xml configuration
is to just add a line to the default constructor in 
  this.publishedAddressPolicy.setPublishedHostStrategy( PublishedAddressPolicy.PublishedHostStrategy.IPADDRESS

and put my newly created jar file (that just contains the recompiled aaa_hack_DiscoverByIp_activemq-broker-5.8.0.jar
in the ActiveMQ lib folder (this works on Linux and Win - the aaa prefix
on my jar was to get this jar to appear earlier in the class path than
the other jars).

On Sun, 2013-07-07 at 21:45 -0400, Christian Posta wrote:
> Post what you have... it should work..
> How are you trying to discover the instances?
> On Sun, Jul 7, 2013 at 1:06 PM, Laurence <> wrote:
> > Hi,
> >
> > I'm trying to get activemq discovery via xml configuration to work by
> > broadcasting machine ip address instead of name (I can make this happen
> > with
> > Groovy code for an embedded broker, but I want to do this for a standard
> > default activemq install with xml configuration).
> >
> > I've read that in the past this was not possible with ActiveMQ with
> > configuration to configure the connector publishedAddressPolicy, but I also
> > did some googling which led me to think it might be possible now with
> > ActiveMQ.
> >
> > I've tried to configure the connector publishedAddressPolicy for ActiveMQ
> > 5.8, but have not been able to get this to work.  Does anyone know if it is
> > really possible to configure the publishedAddressPolicy for a connector? If
> > so could you send me an example?
> >
> > Thanks,
> >
> > Laurence
> >
> > p.s. The reason I want this to work is so that a default Redhat (or Redhat
> > clones) installation can successfully discover activemq server instances
> > (Mac and Win work fine, but to make Redhat work I need to discover server
> > by
> > IP instead of name).
> >
> >
> >
> > --
> > View this message in context:
> >
> > Sent from the ActiveMQ - User mailing list archive at
> >

View raw message