You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Timothy Creswick <Ti...@vorboss.com> on 2013/11/01 11:24:34 UTC

Setting PublishedAddressPolicy on TransportConnector (incl workaround)

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

Re: Setting PublishedAddressPolicy on TransportConnector (incl workaround)

Posted by brenuart <br...@gmail.com>.
You should probably try:

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



--
View this message in context: http://activemq.2283324.n4.nabble.com/Setting-PublishedAddressPolicy-on-TransportConnector-incl-workaround-tp4673632p4674775.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.