From users-return-31866-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Wed Sep 12 14:14:00 2012 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 4FF71DBFC for ; Wed, 12 Sep 2012 14:14:00 +0000 (UTC) Received: (qmail 43264 invoked by uid 500); 12 Sep 2012 14:13:56 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 42797 invoked by uid 500); 12 Sep 2012 14:13:56 -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 42530 invoked by uid 99); 12 Sep 2012 14:13:55 -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 14:13:55 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of MPilone@npr.org designates 65.55.88.12 as permitted sender) Received: from [65.55.88.12] (HELO tx2outboundpool.messaging.microsoft.com) (65.55.88.12) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2012 14:13:49 +0000 Received: from mail128-tx2-R.bigfish.com (10.9.14.245) by TX2EHSOBE011.bigfish.com (10.9.40.31) with Microsoft SMTP Server id 14.1.225.23; Wed, 12 Sep 2012 14:13:28 +0000 Received: from mail128-tx2 (localhost [127.0.0.1]) by mail128-tx2-R.bigfish.com (Postfix) with ESMTP id 0DDA51200F2 for ; Wed, 12 Sep 2012 14:13:28 +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: 2 X-BigFish: VS2(zzc85fh4015Izz1202h1d1ah1d2ahzz8275dh172c6chz2fh2a8h668h839he5bhf0ah107ah1288h12a5h12bdhbe3k1155h) Received-SPF: pass (mail128-tx2: 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 mail128-tx2 (localhost.localdomain [127.0.0.1]) by mail128-tx2 (MessageSwitch) id 1347459205125645_768; Wed, 12 Sep 2012 14:13:25 +0000 (UTC) Received: from TX2EHSMHS015.bigfish.com (unknown [10.9.14.247]) by mail128-tx2.bigfish.com (Postfix) with ESMTP id 1A1CB3A0046 for ; Wed, 12 Sep 2012 14:13:25 +0000 (UTC) Received: from mta-edge01.npr.org (205.153.36.34) by TX2EHSMHS015.bigfish.com (10.9.99.115) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 12 Sep 2012 14:13:22 +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 10:13:20 -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 10:13:21 -0400 From: Mike Pilone To: users Date: Wed, 12 Sep 2012 10:13:19 -0400 Subject: Dynamic TransportConnector Config with xbean Thread-Topic: Dynamic TransportConnector Config with xbean Thread-Index: Ac2Q8MNH5P6O6Cr0TkSSIUhv2cMasg== Message-ID: 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_CC7610BF7434mpilonenprorg_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: npr.org X-Virus-Checked: Checked by ClamAV on apache.org --_004_CC7610BF7434mpilonenprorg_ Content-Type: multipart/alternative; boundary="_000_CC7610BF7434mpilonenprorg_" --_000_CC7610BF7434mpilonenprorg_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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_CC7610BF7434mpilonenprorg_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I'm trying to= use the ActiveMQ Xbean configuration in a Spring configuration file to con= figure an embedded broker. Up to now I've been simply instantiation a Broke= rService and setting transport connectors and network connectors directly. = I'd like to switch to using the "amq" namespace support but I'm having trou= ble figuring out how to dynamically generate the transport connectors on th= e broker.

My deployments environments vary and many contain multiple interfa= ces so I specify my broker URLs as a comma delimited string in a configurat= ion file, such as:

brokerUrl= s =3D tcp://192.168.1.1:8025,tcp://192.168.10.1:8025,stomp://192.168.1.1:80= 35

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:

&= lt;amq:transportConnectors= >

     <bean f= actory-bean=3D"networkInterfac= eTransportConnectorFactory" factory-method= =3D"create" />

   </amq:transportConnectors>


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


org.springframe= work.beans.ConversionNotSupportedException: Failed to convert property valu= e of type 'java.util.ArrayList' 

= to required type 'java.util.List' for pr= operty 'transportConnectors'; nested exception is java.lang.IllegalStateExc= eption: Cannot convert value of type [java.util.ArrayList] to required type= [org.apache.activemq.broker.TransportConnector] for property 'transportCon= nectors[0]': no matching editors or conversion strategy found


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


Thanks,

-mike


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

--_000_CC7610BF7434mpilonenprorg_-- --_004_CC7610BF7434mpilonenprorg_--