activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Arend Jansen <non...@xs4all.nl>
Subject Re: [Spam: 5.0] Two brokers when embedding in Jboss
Date Thu, 15 Mar 2007 18:31:44 GMT

Hiram,

You are probably right about the classloader. Jboss has a pretty complex
classloader scheme, so it wouldn't supprise me that the RAR runs on a
different classloader... Anyway, thanks for the advice on this.

J.A.

Hiram Chirino wrote:
> 
> On 3/14/07, Jan Arend Jansen <nonose@xs4all.nl> wrote:
>>
>> James,
>>
>> Sugestion 1 did the trick. I changed the ra.xml from vm://localhost to
>> tcp://localhost:61616 and now I just have the embedded broker.
>>
> 
> great!
> 
>> I failed to test your second suggestion with the vm://nameOfYourBroker.
>> Does
>> this mean the broker-config.xml needs a transportConnector configured
>> like
>> so?
>>
>> <transportConnector uri="vm://embedded"
>> discoveryUri="multicast://default"/>
>>
> 
> nope.  It means that if you gave your broker a name on the <broker>
> element, the vm://brokerName needs to match.
> 
>>
>> I am wondering what the side-effects of the first action are. Does this
>> mean
>> that I loose the efficiency of the vm transport, because the tcp network
>> roundtrip is introduced?
>>
> 
> Yes a little bit of overhead is introduced but since it's a local tcp
> connection it should still be very quick.  But the vm:// connection
> can only work if your client is in the same classloader tree as the
> ActiveMQ broker.  Perhaps the problem was that they were in different
> classloaders.
> 
>> Cheers,
>> Jan Arend
>>
>>
>> James.Strachan wrote:
>> >
>> > On 3/14/07, James Strachan <james.strachan@gmail.com> wrote:
>> >> On 3/11/07, Jan Arend Jansen <nonose@xs4all.nl> wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > I've embedded activemq 4.1.0 into jboss 4.0.5 by using the RAR. I've
>> >> > modified the ra.xml to start an embedded broker. I use EJB3, like
>> so:
>> >> >
>> >> > @MessageDriven(
>> >> >                 name="jms/EventListener",
>> >> >                 activationConfig =
>> >> >         {
>> >> >                 @ActivationConfigProperty(propertyName =
>> >> "destinationType", propertyValue
>> >> > = "javax.jms.Topic"),
>> >> >                 @ActivationConfigProperty(propertyName =
>> "Destination",
>> >> propertyValue =
>> >> > "topic.workflow_event"),
>> >> >                 @ActivationConfigProperty(propertyName =
>> >> "acknowledgeMode", propertyValue
>> >> > = "Auto-acknowledge"),
>> >> >                 @ActivationConfigProperty(propertyName =
>> >> "subscriptionDurability",
>> >> > propertyValue = "NonDurable")
>> >> >         },
>> >> >         messageListenerInterface=MessageListener.class
>> >> > )
>> >> > @ResourceAdapter("activemq-rar-4.1.0-incubator.rar")
>> >> > public class EventListenerBean implements MessageListener
>> >> > {
>> >> >            public void onMessage(Message recvMsg)
>> >> >            {
>> >> >               System.out.println("----------------");
>> >> >               System.out.println("Received message");
>> >> >               System.out.println("----------------");
>> >> >            }
>> >> > }
>> >> >
>> >> > Whenever this bean is activated, a second broker (named 'localhost'
>> >> seams to
>> >> > be started). The activemq 'list' tool gives the following result:
>> >> >
>> >> > ACTIVEMQ_HOME: D:\Java
>> >> > BrokerName = localhost
>> >> >
>> >> > BrokerName = embedded
>> >> >
>> >> > Although the configuration works, it bothers me that there are two
>> >> brokers
>> >> > active instead of one....is this how it is supposed to be?
>> >>
>> >> Sounds like this issue...
>> >>
>> http://activemq.apache.org/the-vm-transport-starts-a-broker-before-my-configured-broker-starts.html
>> >>
>> >> switch your RAR configuration to use tcp:// will avoid the
>> >> vm://localhost broker being auto-started.
>> >
>> > Or use vm://theNameOfTheBroker from your activemq.xml file
>> >
>> > --
>> >
>> > James
>> > -------
>> > http://radio.weblogs.com/0112098/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Two-brokers-when-embedding-in-Jboss-tf3385705s2354.html#a9483325
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Regards,
> Hiram
> 
> Blog: http://hiramchirino.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Two-brokers-when-embedding-in-Jboss-tf3385705s2354.html#a9500704
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message