activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Pilone <>
Subject Re: Dynamic TransportConnector Config with xbean
Date Wed, 12 Sep 2012 16:20:03 GMT
Nevermind. I found I was just able to do:

<amq:broker id="broker" useJmx="true" start="true">


     <amq:kahaDB  directory="$data_path}"/>


   <property name="brokerName" ref="brokerName" />

   <property name="transportConnectors">

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


    <property name="networkConnectors">

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




I didn't realize that I could mix normal spring context property tags with the amq namespaced
broker definition.


[cid:1E7CF47D-2660-4B4E-87D3-918850FE9EA8] | Mike Pilone | Software Architect, Distribution
|<> | o: 202-513-2679  m: 703-969-7493

From: Mike Pilone <<>>
Reply-To: "<>" <<>>
Date: Wednesday, September 12, 2012 10:13 AM
To: users <<>>
Subject: Dynamic TransportConnector Config with xbean

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:




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