You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by toxel <an...@gmail.com> on 2006/03/28 09:34:36 UTC

Embedded Brokers discovery

hello
how I can configure embedded broker with discovery without xml
configuration.
I want to take functionality of xml :
transportConnector uri="tcp://localhost:0"
discoveryUri="multicast://default"
--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3624998
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Embedded Brokers discovery

Posted by kitplummer <ki...@gmail.com>.
You mean Rendezvous was Apple's name for their instatiation of ZeroConf, but
now its called Bonjour.  I did get the jmdns.jar into the lib
subdirectory...though it obviously didn't ever get loaded, as the code has
been commented out.

But thanks.

--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3643198
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Embedded Brokers discovery

Posted by Jonas Lim <jl...@exist.com>.
Hi,

Try using the rendezvous protocol.    I  think the zeroconf protocol is now 
known as the rendezvous protocol.  You will have to add the jmdns jar on 
your classpath since it's not included in the distro.


Regards,
Jonas

----- Original Message ----- 
From: "kitplummer" <ki...@gmail.com>
To: <ac...@geronimo.apache.org>
Sent: Wednesday, March 29, 2006 8:54 AM
Subject: Re: Embedded Brokers discovery


>
> Ok, so I noticed in the code everything has been commented out.  I suppose
> this is due to the LGPL on the jmDNS stuff.  What is the plan?  I know 
> there
> is multicast capability, but I want to register with mDNS.  Am I seeing 
> that
> this isn't possible anymore?
> --
> View this message in context: 
> http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3641404
> Sent from the ActiveMQ - User forum at Nabble.com. 


Re: Embedded Brokers discovery

Posted by kitplummer <ki...@gmail.com>.
Ok, so I noticed in the code everything has been commented out.  I suppose
this is due to the LGPL on the jmDNS stuff.  What is the plan?  I know there
is multicast capability, but I want to register with mDNS.  Am I seeing that
this isn't possible anymore?
--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3641404
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Embedded Brokers discovery

Posted by themitchy <mi...@sophos.com>.
Were you ever able to get this to work?  I really need to get discovery
working but since AMQ leaves off the protocol and domain I can't use real
Bonjour or mdns libraries.  Using java isn't an option since it has to be
perl.


kitplummer wrote:
> 
> 
> James (and everyone else),
> 
> Ok, I feel somewhat stupid now.  What I'm really looking for is to have
> the ActiveMQ broker show up in my Bonjour Browser window.  Now to make
> that happen I'm think I need to add some stuff to the "ActiveMQ-4." string
> to make it end up more like "default._ActiveMQ-4._tcp.local." which would
> then appear in the mdns browser.  I've edited the
> RendevousDiscoveryAgent.java code, but am still not seeing it.  Looking a
> little closer at the code there, I am thinking I somehow need to call the
> registerService method in order for it to actually make it to the mDNS
> server.  Any help here would be greatly appreciated.
> 
> TIA,
> Kit
> 

-- 
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-tp3624998p25390692.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Embedded Brokers discovery

Posted by James Strachan <ja...@gmail.com>.
On 4/4/06, kitplummer <ki...@gmail.com> wrote:
> James.Strachan wrote:
> >
> > On 3/30/06, kitplummer <ki...@gmail.com> wrote:
> >>
> >> Yes, this discovery method works.  However, I want to use mDNS.  Just to
> >> finalize this...
> >>
> >> Is there no more support for jmDNS?
> >
> > No - the code is still there. Use rendezvous:foo
> >
> > I've just committed a test case using it which seems to work.
> > http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/RendezvousDiscoverTransportTest.java
> >
> > --
> >
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> >
> >
>
> James (and everyone else),
>
> Ok, I feel somewhat stupid now.  What I'm really looking for is to have the
> ActiveMQ broker show up in my Bonjour Browser window.  Now to make that
> happen I'm think I need to add some stuff to the "ActiveMQ-4." string to
> make it end up more like "default._ActiveMQ-4._tcp.local." which would then
> appear in the mdns browser.  I've edited the RendevousDiscoveryAgent.java
> code, but am still not seeing it.  Looking a little closer at the code
> there, I am thinking I somehow need to call the registerService method in
> order for it to actually make it to the mDNS server.  Any help here would be
> greatly appreciated.

Note that things appear straight away if you use the browser that
comes with jmDNS

java -jar lib/jmdns.jar -browse

then it appears.

I've just patch SVN HEAD to explicitly prepend a "_" to ensure that
the names look a bit nicer in rendezvous. I even tried hacking
RendevousDiscoveryAgent to use similar naming schemes to other
services but I couldn't get the Bonjour Browser to pick it up - no
idea what the magic is (maybe known services have to be configured
into it in the right way for it to recognise it?)

--

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

Re: Embedded Brokers discovery

Posted by kitplummer <ki...@gmail.com>.

James.Strachan wrote:
> 
> On 3/30/06, kitplummer <ki...@gmail.com> wrote:
>>
>> Yes, this discovery method works.  However, I want to use mDNS.  Just to
>> finalize this...
>>
>> Is there no more support for jmDNS?
> 
> No - the code is still there. Use rendezvous:foo
> 
> I've just committed a test case using it which seems to work.
> http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/RendezvousDiscoverTransportTest.java
> 
> --
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

James (and everyone else),

Ok, I feel somewhat stupid now.  What I'm really looking for is to have the
ActiveMQ broker show up in my Bonjour Browser window.  Now to make that
happen I'm think I need to add some stuff to the "ActiveMQ-4." string to
make it end up more like "default._ActiveMQ-4._tcp.local." which would then
appear in the mdns browser.  I've edited the RendevousDiscoveryAgent.java
code, but am still not seeing it.  Looking a little closer at the code
there, I am thinking I somehow need to call the registerService method in
order for it to actually make it to the mDNS server.  Any help here would be
greatly appreciated.

TIA,
Kit
--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3735584
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Embedded Brokers discovery

Posted by James Strachan <ja...@gmail.com>.
On 3/30/06, kitplummer <ki...@gmail.com> wrote:
>
> Yes, this discovery method works.  However, I want to use mDNS.  Just to
> finalize this...
>
> Is there no more support for jmDNS?

No - the code is still there. Use rendezvous:foo

I've just committed a test case using it which seems to work.
http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/RendezvousDiscoverTransportTest.java

--

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

Re: Embedded Brokers discovery

Posted by kitplummer <ki...@gmail.com>.
Yes, this discovery method works.  However, I want to use mDNS.  Just to
finalize this...

Is there no more support for jmDNS?  Will the code still exist, allowing for
the capability to compiled in?  Or is the Apache relationship going to
dictate that it (the code) go away completely?
--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3671949
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Embedded Brokers discovery

Posted by James Strachan <ja...@gmail.com>.
On 3/29/06, kitplummer <ki...@gmail.com> wrote:
>
> Making a newbie assumption that to add zeroconf registration all I need to do
> is add discovery to the front of the URI.
>
> But.  Here's the output I get:

The code Jonas provided should work fine...

       BrokerService broker = new BrokerService();
       broker..setUseJmx(false);
       broker.setPersistent(false);
       TransportConnector connector = broker.addConnector(new
URI("tcp://localthost:61616"));
       connector.setDiscoveryUri(new URI("multicast://default"));
       broker.start();


In this case, you want to create a TCP server side transport and add a
discovery mechanism to it. Adding discovery to the front of a URI is
purely used on the client side.

--

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

Re: Embedded Brokers discovery

Posted by kitplummer <ki...@gmail.com>.
Making a newbie assumption that to add zeroconf registration all I need to do
is add discovery to the front of the URI.

But.  Here's the output I get:

     [java] Starting ActiveMQ...
     [java] Mar 28, 2006 5:06:42 PM org.apache.activemq.broker.BrokerService
getBroker
     [java] INFO: ActiveMQ 4.0-M4 JMS Message Broker (eMAF) is starting
     [java] Mar 28, 2006 5:06:42 PM org.apache.activemq.broker.BrokerService
getBroker
     [java] INFO: For help or more information please see:
http://www.logicblaze.com
     [java] Mar 28, 2006 5:06:44 PM
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter createAdapter
     [java] INFO: Database driver recognized:
[apache_derby_embedded_jdbc_driver]
     [java] Mar 28, 2006 5:06:46 PM
org.apache.activemq.store.journal.JournalPersistenceAdapter recover
     [java] INFO: Journal Recovery Started from: Active Journal: using 2 x
20.0 Megs at: activemq-data/eMAF/journal
     [java] Mar 28, 2006 5:06:46 PM
org.apache.activemq.store.journal.JournalPersistenceAdapter recover
     [java] INFO: Journal Recovered: 0 message(s) in transactions recovered.
     [java] java.io.IOException: Invalid server URI:
discovery:tcp://localhost:61616
     [java]     at
org.apache.activemq.transport.discovery.DiscoveryTransportFactory.doBind(DiscoveryTransportFactory.java:47)
     [java]     at
org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:108)
     [java]     at
org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:928)
     [java]     at
org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:134)
     [java]     at
com.raytheon.ap.emaf.comm.ActiveMQ$BrokerThread.run(Unknown Source)

Any ideas?  What am I doing wrong?  FWIW, I tried added the discovery option
to the example activemq.xml configuration and tried to start a broker with
the script and get the same thing...

TIA,
Kit
--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3640934
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Embedded Brokers discovery

Posted by jlim <jl...@exist.com>.
Hi,

If you have downloaded the source code of AMQ 4.x, you can find some test
cases that will be helpful:

trunk\activemq-core\src\test\java\org\apache\activemq\core\     (ie.
ActiveMQConnectionFactoryTest)


 Below is a sample configuration of the Broker using java configuration :

        BrokerService broker = new BrokerService();
        broker..setUseJmx(false);
        broker.setPersistent(false);
        TransportConnector connector = broker.addConnector(new
URI("tcp://localthost:61616"));
        connector.setDiscoveryUri(new URI("multicast://default"));
        broker.start();


Regards,
Jonas

--
View this message in context: http://www.nabble.com/Embedded-Brokers-discovery-t1354095.html#a3627452
Sent from the ActiveMQ - User forum at Nabble.com.