You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "massive.boisson" <ma...@gmail.com> on 2006/05/31 02:45:12 UTC

embedded broker and in VM protocol

Hi, I am using active mq 4 (incubator).
I read, I think, all the docs and went thru many messages.

Please, let me know if this is True or False (and expect flurry of questions
if it is false :)): 
embedded broker means that one JVM is shared by broker and lets say producer
and consumer. If I created broker with Java code having url =
tcp://localhost:61616, and my producer and consumer both create connections
to tcp://localhost:61616, will they be using VM protocol?. 

Thanks a lot

--MB

--
View this message in context: http://www.nabble.com/embedded+broker+and+in+VM+protocol-t1708110.html#a4637423
Sent from the ActiveMQ - User forum at Nabble.com.


Re: embedded broker and in VM protocol

Posted by James Strachan <ja...@gmail.com>.
On 6/1/06, massive.boisson <ma...@gmail.com> wrote:
>
> Thanks for the answer. A lot.
>
> This is what I did and it works (for the benefit of future users).
> (I guess docs say as much.)
>
> Broker started from code, url set to tcp://localhost:61616, name to
> myBroker.
> In the same JVM a producer and consumer with connection urls vm://myBroker.
> (it wouldn't work if I specified vm://localhost:61616. i'd get:
> java.lang.NoClassDefFoundError: MalformedObjectNameException).

We're probably using the broker name "localhost:61616" and using that
to make an MBean name where : is probably a reserved character.


> In another JVM producer and consumer with connection urls
> tcp://localhost:61616.
>
> It all works as I expect it.
>
> I guess the only other thing that I dont understand is why do I need to set
> transport scheme (tcp://) when specifying broker url. But I'd say this is
> relatively minor.

We support various transport protocols; failover: tcp: vm: peer: so
its up to the client to say how it wants to connect to the brokers &
what host names & ports to use. Though ActiveMQConnectionFactory does
have a sensible default if you just wanna create that POJO and use it

-- 

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

Re: embedded broker and in VM protocol

Posted by "massive.boisson" <ma...@gmail.com>.
Thanks for the answer. A lot.

This is what I did and it works (for the benefit of future users). 
(I guess docs say as much.)

Broker started from code, url set to tcp://localhost:61616, name to
myBroker.
In the same JVM a producer and consumer with connection urls vm://myBroker. 
(it wouldn't work if I specified vm://localhost:61616. i'd get:
java.lang.NoClassDefFoundError: MalformedObjectNameException).

In another JVM producer and consumer with connection urls
tcp://localhost:61616.

It all works as I expect it.

I guess the only other thing that I dont understand is why do I need to set
transport scheme (tcp://) when specifying broker url. But I'd say this is
relatively minor.

Again, thanks a lot.

--MB
--
View this message in context: http://www.nabble.com/embedded+broker+and+in+VM+protocol-t1708110.html#a4653571
Sent from the ActiveMQ - User forum at Nabble.com.


Re: embedded broker and in VM protocol

Posted by James Strachan <ja...@gmail.com>.
On 5/31/06, massive.boisson <ma...@gmail.com> wrote:
>
> Hi, I am using active mq 4 (incubator).
> I read, I think, all the docs and went thru many messages.
>
> Please, let me know if this is True or False (and expect flurry of questions
> if it is false :)):
> embedded broker means that one JVM is shared by broker and lets say producer
> and consumer.

The VM protocol is used by JMS clients (producers or consumers) to
talk to a broker in the same JVM. It means commands can be exchanged
by reference rather than having to marshall them on/off a socket etc.


> If I created broker with Java code having url =
> tcp://localhost:61616, and my producer and consumer both create connections
> to tcp://localhost:61616, will they be using VM protocol?.

No - they use the TCP protocol. To use the VM protocol then use the
vm://localhost URI

http://incubator.apache.org/activemq/vm-transport-reference.html
http://incubator.apache.org/activemq/tcp-transport-reference.html

-- 

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