Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35A13DCBD for ; Wed, 12 Sep 2012 16:20:42 +0000 (UTC) Received: (qmail 39317 invoked by uid 500); 12 Sep 2012 16:20:41 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 39286 invoked by uid 500); 12 Sep 2012 16:20:41 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 39277 invoked by uid 99); 12 Sep 2012 16:20:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2012 16:20:41 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of MPilone@npr.org designates 216.32.180.186 as permitted sender) Received: from [216.32.180.186] (HELO co1outboundpool.messaging.microsoft.com) (216.32.180.186) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2012 16:20:35 +0000 Received: from mail18-co1-R.bigfish.com (10.243.78.234) by CO1EHSOBE006.bigfish.com (10.243.66.69) with Microsoft SMTP Server id 14.1.225.23; Wed, 12 Sep 2012 16:20:13 +0000 Received: from mail18-co1 (localhost [127.0.0.1]) by mail18-co1-R.bigfish.com (Postfix) with ESMTP id 8873492016B for ; Wed, 12 Sep 2012 16:20:13 +0000 (UTC) X-Forefront-Antispam-Report: CIP:205.153.36.34;KIP:(null);UIP:(null);IPV:NLI;H:mta-edge01.npr.org;RD:mta-edge01.npr.org;EFVD:NLI X-SpamScore: 4 X-BigFish: VS4(zz9371Ic85eh4015I9a6kzz1202h1d1ah1d2ahzz8275dh172c6chz2fh2a8h668h839he5bhf0ah107ah1288h12a5h12bdhbe3k1155h) Received-SPF: pass (mail18-co1: domain of npr.org designates 205.153.36.34 as permitted sender) client-ip=205.153.36.34; envelope-from=MPilone@npr.org; helo=mta-edge01.npr.org ;ge01.npr.org ; Received: from mail18-co1 (localhost.localdomain [127.0.0.1]) by mail18-co1 (MessageSwitch) id 1347466809880083_8012; Wed, 12 Sep 2012 16:20:09 +0000 (UTC) Received: from CO1EHSMHS006.bigfish.com (unknown [10.243.78.236]) by mail18-co1.bigfish.com (Postfix) with ESMTP id C896A200042 for ; Wed, 12 Sep 2012 16:20:09 +0000 (UTC) Received: from mta-edge01.npr.org (205.153.36.34) by CO1EHSMHS006.bigfish.com (10.243.66.16) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 12 Sep 2012 16:20:06 +0000 Received: from hq-exch-hub02.ads.npr.org (172.16.11.107) by hq-exch-edge01.ads.npr.org (172.16.10.145) with Microsoft SMTP Server (TLS) id 8.3.279.1; Wed, 12 Sep 2012 12:20:04 -0400 Received: from EXCHANGE.ads.npr.org ([169.254.2.29]) by hq-exch-hub02.ads.npr.org ([::1]) with mapi; Wed, 12 Sep 2012 12:20:05 -0400 From: Mike Pilone To: "users@activemq.apache.org" Date: Wed, 12 Sep 2012 12:20:03 -0400 Subject: Re: Dynamic TransportConnector Config with xbean Thread-Topic: Dynamic TransportConnector Config with xbean Thread-Index: Ac2RAngJw/vhl5F7SNCXppZyq84tPw== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.3.120616 acceptlanguage: en-US x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean Content-Type: multipart/related; boundary="_004_CC762E0C744Bmpilonenprorg_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: npr.org X-Virus-Checked: Checked by ClamAV on apache.org --_004_CC762E0C744Bmpilonenprorg_ Content-Type: multipart/alternative; boundary="_000_CC762E0C744Bmpilonenprorg_" --_000_CC762E0C744Bmpilonenprorg_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Nevermind. I found I was just able to do: =85 I didn't realize that I could mix normal spring context property tags with = the amq namespaced broker definition. -mike [cid:1E7CF47D-2660-4B4E-87D3-918850FE9EA8] | Mike Pilone | Software Archite= ct, Distribution | mpilone@npr.org | o: 202-513-267= 9 m: 703-969-7493 From: Mike Pilone > Reply-To: "users@activemq.apache.org" > 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 configuratio= n file to configure an embedded broker. Up to now I've been simply instanti= ation a BrokerService and setting transport connectors and network connecto= rs 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 con= nectors 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 =3D tcp://192.168.1.1:8025,tcp://192.168.10.1:8025,stomp://192.1= 68.1.1:8035 I have a bean factory that I created that can generate a java.util.ArrayLis= t of TransportConnectors to use; however I don't see any easy way to refere= nce 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 conver= t property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'transportConnectors'; neste= d exception is java.lang.IllegalStateException: Cannot convert value of typ= e [java.util.ArrayList] to required type [org.apache.activemq.broker.Transp= ortConnector] 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 envi= ronment/profile support, but I'd like to just be able to set a list of prec= onfigured transport connectors on the broker during construction. Any sugge= stions? Thanks, -mike [cid:9B908586-F4CE-45B1-ACE5-C4E217447737] | Mike Pilone | Software Archite= ct, Distribution | mpilone@npr.org | o: 202-513-267= 9 m: 703-969-7493 --_000_CC762E0C744Bmpilonenprorg_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Nevermind. I fo= und I was just able to do:

= <am= q:broker id=3D"broker&qu= ot; us= eJmx=3D"true" start= =3D"true">

   <amq:persistenceAdapter>

     <amq:= kahaDB  directory=3D&quo= t;$data_path}"/>

   </amq:persistenceAdapter>

 

   <property n= ame=3D"brokerName" ref=3D"brokerName" />

 

   <property n= ame=3D"transportConnector= s">

     <bean= =3D"network= InterfaceTransportConnectorFactory" factory-method=3D"create" />

   </property&= gt;

   

    <property = name=3D"networkConnectors= ">

      <= span style=3D"color: #009193"><bea= n factory-bean=3D"networ= kInterfaceNetworkConnectorFactory" factory-method=3D"create" />

    </property= >

=85

</amq:broker>


<= /font>

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


-mike


 | Mike Pilone | Software Architect, Distribution | mpilone@npr.org | o: 202-513-2679  m: 703-969-7493


From: Mike Pilone <<= a href=3D"mailto:mpilone@npr.org">mpilone@npr.org>
Reply-To: "users@activemq.apache.org" <users@activemq.apache.org>
Date: Wednesday, September 12, 2012 10:13 AM
<= span style=3D"font-weight:bold">To: users <users@activemq.apache.org>
Subject: Dynamic TransportConnector Config with = xbean


My deployme= nts 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 =3D tcp://192.168.= 1.1:8025,tcp://192.168.10.1:8025,stomp://192.168.1.1:8035

I have a be= an factory that I created that can generate a java.util.ArrayList of Transp= ortConnectors to use; however I don't see any easy way to reference this li= st from the Xbean configuration. I want to do something like:

<amq:transportConnectors>

     <beanfactory-bean=3D"= ;networkInterfaceTransportConnectorFactory"factory-method=3D"create"/>

   </amq:transportC= onnectors>


But that doesn't seem to work and g= enerates the error:


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

to required type 'java.u= til.List' for property 'transportConnectors'; nested exception is java.lang= .IllegalStateException: Cannot convert value of type [java.util.ArrayList] = to required type [org.apache.activemq.broker.TransportConnector] for property 'transportConnectors[0]': no matching editors or conversion s= trategy found


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


Thanks,

-mike


 | Mike Pilone | Software Architect, Distribution | mpilone@npr.org | o: 202-51= 3-2679  m: 703-969-7493

--_000_CC762E0C744Bmpilonenprorg_-- --_004_CC762E0C744Bmpilonenprorg_--