activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: how to configure an embed broker with an optional tcp transport
Date Thu, 19 Oct 2006 08:43:41 GMT
I'd suggest using your own Java code to construct the broker, then you
can use an if () around the
broker.addConnector("tcp://localhost:port")) line of code.

Some example code here...
http://incubator.apache.org/activemq/how-do-i-embed-a-broker-inside-a-connection.html

If you really want you could wrap up your Java code as a Spring FactoryBean

On 10/19/06, christophe blin <cblin@tennaxia.com> wrote:
>
> Hi,
>
> I'd like to configure an embed broker that use vm and tcp transport, but
> with the tcp tranport being optional.
> At the moment, if I use a blank value for the tcp transport, then the bean
> initialisation failed (see at the bottom of this message).
>
> If this is not very clear, here is an example of what I'd like to do.
>
> The following is working :
>
>   <bean id="broker" class="org.apache.activemq.xbean.XBeanBrokerService">
>     <property name="persistenceAdapter">
>       <bean class="org.apache.activemq.store.jdbc.JDBCPersistenceAdapter">
>         <property name="dataSource" ref="ds" />
>       </bean>
>     </property>
>     <property name="transportConnectorURIs">
>       <list>
>         <value>vm://localhost</value>
>         <value>tcp://localhost:61365</value><!-- and sometimes
> <value></value> -->
>       </list>
>     </property>
>     <property name="start" value="true" />
>   </bean>
>
> What I'd like is to externalize the "tcp://localhost:61365" into a
> properties file and to make it optional (i.e if the user said
> "jms.embedbroker=" then I do not want the exception to appear)
>
> exception that appear if I use a blank value :
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'broker' defined in class path resource [jms-spring.xml]:
> Invocation of init method failed; nested exception is java.io.IOException:
> Transport not scheme specified: []
>
> thanks for any help,
> regards,
> chris
> --
> View this message in context: http://www.nabble.com/how-to-configure-an-embed-broker-with-an-optional-tcp-transport-tf2471995.html#a6892699
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message