activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Creswick <Timothy.Cresw...@vorboss.com>
Subject Setting PublishedAddressPolicy on TransportConnector (incl workaround)
Date Fri, 01 Nov 2013 10:24:34 GMT
Hi,

We need to set the publishedAddressPolicy parameter on the openwire transportConnector to
PublishedHostStrategy.IPADDRESS (or even FQDN). The default unqualified hostname isn't terribly
helpful in larger networks.

I've tested this on 5.8 and 5.9 but I seem to have encountered a problem in the XSD / bean
processor.

The configuration that should work according to the XSD is:

<transportConnector name="openwire" uri="tcp://1.2.3.4:61616">
  <publishedAddressPolicy publishedHostStrategy="IPADDRESS" />
</transportConnector>

However this gives me the error:

Attribute 'publishedHostStrategy' is not allowed to appear in element 'publishedAddressPolicy'.

I've spent quite a lot of time trying to debug this (and looking for a JIRA item) and eventually
gave up and have used the following XML workaround:

<transportConnector name="openwire" uri="tcp://1.2.3.4:61616">
 <property xmlns="http://www.springframework.org/schema/beans" name="publishedAddressPolicy">
  <bean class="org.apache.activemq.broker.PublishedAddressPolicy">
   <property name="publishedHostStrategy">
    <bean class="org.apache.activemq.broker.PublishedAddressPolicy.PublishedHostStrategy"
factory-method="valueOf">
     <constructor-arg value="IPADDRESS" />
    </bean>
   </property>
  </bean>
 </property>
</transportConnector>

Essentially, dropping out of the ActiveMQ namespace and using standard Spring beans configuration.

Whilst this is now working for us, I wondered if there is something we have missed using the
"official" configuration schema and/or whether this needs to be raised as a bug.

Thanks

Mime
View raw message