You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by davidgeary <da...@aepona.com> on 2009/10/05 16:58:23 UTC

Enable discovery in embedded broker URL

I'm setting up an embedded broker in a connection factory in spring with the
following URL:

 <property name="brokerURL"
value="vm:(broker:(tcp://localhost:61618,network:multicast://default)?persistent=false&amp;brokerName=ec-amq)"/>

Whats the correct syntax for the broker URL in order to set up discovery on
the transport connection? Ie if I was using ActiveMQ XML configuration it
would be 

<transportConnectors>
        <transportConnector
            name="openwire" uri="tcp://localhost:61618"
discoveryUri="multicast://default"/>
</transportConnectors>

I can't see how to get the discoeryUri into the brokerURL?

Thanks for any help 

Dave


-- 
View this message in context: http://www.nabble.com/Enable-discovery-in-embedded-broker-URL-tp25752382p25752382.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Enable discovery in embedded broker URL

Posted by davidgeary <da...@aepona.com>.

Thanks for the reply, the application context snippet in my original post
was a bit misleading as i was just using that to test out brokerURLs to try
to get it working, actually I'm trying to set it up from JNDI within another
product which allows me to set the initial context properties, currently I
have 

java.naming.provider.url =
vm://localhost?brokerConfig=xbean:file:/activemqconfig/activemq-broker.xml

And within the config file I have the broker set up something like you
describe, however for simplicity I was hoping to avoid the need for this
file and set it up with just a broker URL. 

ie

java.naming.provider.url =
vm:(broker:(tcp://localhost:61618,network:multicast://default)?persistent=false&brokerName=ec-amq) 

but including the discovery uri also

If its not possible I can just stick with what I have.


-- 
View this message in context: http://www.nabble.com/Enable-discovery-in-embedded-broker-URL-tp25752382p25765830.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Enable discovery in embedded broker URL

Posted by Gary Tully <ga...@gmail.com>.
the set of options that can be configured via the broker: url scheme
is limited to simple strings.

Simplest way may be to introduce a broker bean into your application context.

To reference an external xml configuration use something like:

<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
    <property name="config" value="classpath:activemq.xml" />
    <property name="start" value="true" />
</bean>


or you could explicitly configure a broker bean using the xml syntax:

<amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
      <amq:transportConnector uri="tcp://localhost:0" />
    </amq:transportConnectors>
  </amq:broker>

see: http://activemq.apache.org/spring-support.html for more detail



2009/10/5 davidgeary <da...@aepona.com>
>
> I'm setting up an embedded broker in a connection factory in spring with the
> following URL:
>
>  <property name="brokerURL"
> value="vm:(broker:(tcp://localhost:61618,network:multicast://default)?persistent=false&amp;brokerName=ec-amq)"/>
>
> Whats the correct syntax for the broker URL in order to set up discovery on
> the transport connection? Ie if I was using ActiveMQ XML configuration it
> would be
>
> <transportConnectors>
>        <transportConnector
>            name="openwire" uri="tcp://localhost:61618"
> discoveryUri="multicast://default"/>
> </transportConnectors>
>
> I can't see how to get the discoeryUri into the brokerURL?
>
> Thanks for any help
>
> Dave
>
>
> --
> View this message in context: http://www.nabble.com/Enable-discovery-in-embedded-broker-URL-tp25752382p25752382.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



--
http://blog.garytully.com

Open Source Integration
http://fusesource.com