activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Pilone <>
Subject Dynamic TransportConnector Config with xbean
Date Wed, 12 Sep 2012 14:13:19 GMT
I'm trying to use the ActiveMQ Xbean configuration in a Spring configuration file to configure
an embedded broker. Up to now I've been simply instantiation a BrokerService and setting transport
connectors and network connectors directly. I'd like to switch to using the "amq" namespace
support but I'm having trouble figuring out how to dynamically generate the transport connectors
on the broker.

My deployments environments vary and many contain multiple interfaces so I specify my broker
URLs as a comma delimited string in a configuration file, such as:

brokerUrls = tcp://,tcp://,stomp://

I have a bean factory that I created that can generate a java.util.ArrayList of TransportConnectors
to use; however I don't see any easy way to reference this list from the Xbean configuration.
I want to do something like:


     <bean factory-bean="networkInterfaceTransportConnectorFactory" factory-method="create"


But that doesn't seem to work and generates the error:

org.springframework.beans.ConversionNotSupportedException: Failed to convert property value
of type 'java.util.ArrayList'

to required type 'java.util.List' for property 'transportConnectors'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type [java.util.ArrayList] to required
type [] for property 'transportConnectors[0]':
no matching editors or conversion strategy found

I'm sure I could make this work through some combination of Spring 3's environment/profile
support, but I'd like to just be able to set a list of preconfigured transport connectors
on the broker during construction. Any suggestions?



[cid:9B908586-F4CE-45B1-ACE5-C4E217447737] | Mike Pilone | Software Architect, Distribution
|<> | o: 202-513-2679  m: 703-969-7493

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message