activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Jabali <mjab...@fusesource.com>
Subject Re: Understanding basic config
Date Sat, 01 Oct 2011 07:06:56 GMT
Mohit,

ActiveMQ has several transport protocols available (connection URLs for a client to connect
to a broker).
TCP - is used when clients connect to the broker using a TCP socket. VM - is used when you
are embedding the broker in your app (client and broker running on the same JVM) and you want
to take the performance benefits of connecting the clients to the broker without hitting the
network layer. Everything goes through in-memory buffers.

Hope this helps,

-Marcelo


On Sep 28, 2011, at 4:18 PM, Mohit Anchlia wrote:

> On Wed, Sep 28, 2011 at 3:33 PM, Timothy Bish <tabish121@gmail.com> wrote:
>> On Wed, 2011-09-28 at 14:05 -0700, Mohit Anchlia wrote:
>>> I have this config. Trying to understand few things:
>>> 
>>> 1. what's the different between uri="tcp://localhost:0" and
>>> brokerURL="vm://localhost" ?
>>> 2. In point 1 why are both not tcp?
>>> 3. what is :0? That doesn't look like a port to me. Is this specifial
>>> for embedded broker?
>>> 
>>> 
>>> 
>>>  <amq:broker useJmx="false" persistent="false">
>>>     <amq:transportConnectors>
>>>       <amq:transportConnector uri="tcp://localhost:0" />
>>>     </amq:transportConnectors>
>>>   </amq:broker>
>>> 
>>>    <!--  ActiveMQ destinations to use  -->
>>>   <amq:queue id="destination"
>>> physicalName="org.apache.activemq.spring.Test.spring.embedded"/>
>>> 
>>>   <!-- JMS ConnectionFactory to use, configuring the embedded broker
>>> using XML -->
>>>   <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
>> 
>> Have a look at the Version 5 Transports page for info on the various
>> transports.
>> http://activemq.apache.org/configuring-version-5-transports.html
>> 
>> For the TCP transport setting the port to zero means that you want the
>> broker to pick an open TCP port.  Normally you wouldn't do this in the
>> configuration since will change every time you start the broker, this is
>> more useful for unit tests where you want to ensure you get an open
>> port.
>> 
>> 
> 
> I couldn't get answer to my point 1 and 2
> 
> 1. what's the different between uri="tcp://localhost:0" and
> brokerURL="vm://localhost" ?
> 
>  <amq:broker id="BridgeBroker" useJmx="true" persistent="false">
>    <amq:transportConnectors>
>      <amq:transportConnector uri="tcp://localhost:0" />
>    </amq:transportConnectors>
>  </amq:broker>
> 
>  <!-- JMS ConnectionFactory to use, configuring the embedded broker
> using XML -->
>  <amq:connectionFactory id="BridgeJmsFactory" brokerURL="vm://bridgehost"/>
> 
> 2. In point 1 why are both not tcp?
> 
> 3. And in point 1 how is broker getting associated with the
> connectionfactory since url is different?
> 
> 
>> Regards
>> 
>> 
>> 
>> --
>> Tim Bish
>> ------------
>> FuseSource
>> Email: tim.bish@fusesource.com
>> Web: http://fusesource.com
>> Twitter: tabish121
>> Blog: http://timbish.blogspot.com/
>> 
>> 
>> 
>> 







Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message