You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by christophe blin <cb...@tennaxia.com> on 2006/10/19 10:39:27 UTC

how to configure an embed broker with an optional tcp transport

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.


Re: how to configure an embed broker with an optional tcp transport

Posted by James Strachan <ja...@gmail.com>.
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 <cb...@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/