Discussion:
Problems with VM transport
u***@public.gmane.org
2007-03-25 22:22:51 UTC
Permalink
Hello...

I have a couple of basic questions on ActiveMQ. I would appreciate any hits as I am stuck.

I am using ActiveMQ 4.1 with JDK6.

1) When I use an embedded broker with vm transport (vm://localhost)
the instantiation of my Spring SimpleMessageListenerContainer
always fails with a JournalLockedException.

What does this exception mean exactly? I understand this has something to do with
persistance of message (since that is on by default). While I do not
care to enable persistance and would like to turn it off, I would still
like to understand what causes this exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DmmStartupMessageListener' defined in class path resource [contexts/bus/DmsStandardSubscriptions.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/activeio/journal/active/JournalLockedException
Caused by:
java.lang.NoClassDefFoundError: org/apache/activeio/journal/active/JournalLockedException
at org.apache.activemq.broker.BrokerService.createPersistenceFactory(BrokerService.java:1328)
at org.apache.activemq.broker.BrokerService.getPersistenceFactory(BrokerService.java:544)
at org.apache.activemq.broker.BrokerService.createPersistenceAdapter(BrokerService.java:1320)
at org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerService.java:631)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1250)
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:113)
at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:52)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:43)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:77)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:227)


2) Which jarfile contains the exception class org/apache/activeio/journal/active/JournalLockedException?

3) How do I use an embedded broker without persistance?

The URL

vm://localhost?persistant=false

fails with an exception that says that the option is illegal.

4) Once the broker is up, could I dynamically (programmatically) change the
broker URL by augmenting the broker URL with a failover URL as follows?

Startup: vm://localhost
During runtime (after an event):
failover(vm://localhost,tcp://remote:61616)

Would modifying the broker URL of the connection factory cause problems?

Thanks,

/U
Steven Marcus
2007-03-25 23:39:17 UTC
Permalink
I can only speak to #3. There is a spelling error the URL should read:

vm://localhost?broker.persistent=false


I am using a Spring SimpleMessageListenerContainer on jdk1.6 on linux
with 4.1.1RC1 without the issue you describe. I am fairly sure it
worked with 4.1 too, with a non-persistent broker...

Hope this helps!
S
Christopher G. Stach II
2007-03-26 03:11:36 UTC
Permalink
Post by u***@public.gmane.org
Hello...
I have a couple of basic questions on ActiveMQ. I would appreciate any hits as I am stuck.
I am using ActiveMQ 4.1 with JDK6.
1) When I use an embedded broker with vm transport (vm://localhost)
the instantiation of my Spring SimpleMessageListenerContainer
always fails with a JournalLockedException.
What does this exception mean exactly? I understand this has something to do with
persistance of message (since that is on by default). While I do not
care to enable persistance and would like to turn it off, I would still
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DmmStartupMessageListener' defined in class path resource [contexts/bus/DmsStandardSubscriptions.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/activeio/journal/active/JournalLockedException
java.lang.NoClassDefFoundError: org/apache/activeio/journal/active/JournalLockedException
at org.apache.activemq.broker.BrokerService.createPersistenceFactory(BrokerService.java:1328)
at org.apache.activemq.broker.BrokerService.getPersistenceFactory(BrokerService.java:544)
at org.apache.activemq.broker.BrokerService.createPersistenceAdapter(BrokerService.java:1320)
at org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerService.java:631)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1250)
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:113)
at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:52)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:43)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:77)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:227)
2) Which jarfile contains the exception class org/apache/activeio/journal/active/JournalLockedException?
3) How do I use an embedded broker without persistance?
The URL
vm://localhost?persistant=false
fails with an exception that says that the option is illegal.
4) Once the broker is up, could I dynamically (programmatically) change the
broker URL by augmenting the broker URL with a failover URL as follows?
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Thanks,
/U
This was kind of like watching a retarded kid fall down, and laughing...
but three times in a row. Thanks.
--
Christopher G. Stach II
Manish Gulati
2007-03-26 04:37:44 UTC
Permalink
Hi,

For JournalLockedException, include activeio-core-3.0-beta4.jar (you may
have different version of this) in your classpath.

Regards,
Manish Gulati

CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail
messages appended or attached to it, may contain information that is
confidential or legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that you must not read this
transmission and that any disclosure, copying, printing, distribution,
or use of the information contained or attached to this transmission is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender by telephone +91.172.229.9438 or
return e-mail message mgulati-7I3u/***@public.gmane.org and delete the original
transmission, its attachments, and any copies without reading or saving
in any manner. Thank you.
-----Original Message-----
From: Christopher G. Stach II [mailto:cgs-***@public.gmane.org]
Sent: Monday, March 26, 2007 8:42 AM
To: users-UzBZ5Px8zVWY1pf4d8vP8EB+***@public.gmane.org
Subject: Re: Problems with VM transport
Post by u***@public.gmane.org
Hello...
I have a couple of basic questions on ActiveMQ. I would appreciate any hits as I am stuck.
I am using ActiveMQ 4.1 with JDK6.
1) When I use an embedded broker with vm transport (vm://localhost)
the instantiation of my Spring SimpleMessageListenerContainer
always fails with a JournalLockedException.
What does this exception mean exactly? I understand this has something to do with
persistance of message (since that is on by default). While I do not
care to enable persistance and would like to turn it off, I would still
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'DmmStartupMessageListener' defined in class
path resource [contexts/bus/DmsStandardSubscriptions.xml]: Invocation of
init method failed; nested exception is java.lang.NoClassDefFoundError:
org/apache/activeio/journal/active/JournalLockedException
org/apache/activeio/journal/active/JournalLockedException
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createPersistenceFactory(Broker
Service.java:1328)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getPersistenceFactory(BrokerSer
vice.java:544)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createPersistenceAdapter(Broker
Service.java:1320)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerSer
vice.java:631)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServic
e.java:1250)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java
:1209)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:50
8)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(V
MTransportFactory.java:113)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTranspor
tFactory.java:52)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactor
y.java:43)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.
java:77)
Post by u***@public.gmane.org
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQCo
nnectionFactory.java:227)
Post by u***@public.gmane.org
2) Which jarfile contains the exception class
org/apache/activeio/journal/active/JournalLockedException?
Post by u***@public.gmane.org
3) How do I use an embedded broker without persistance?
The URL
vm://localhost?persistant=false
fails with an exception that says that the option is illegal.
4) Once the broker is up, could I dynamically (programmatically) change the
broker URL by augmenting the broker URL with a failover URL as
follows?
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Thanks,
/U
This was kind of like watching a retarded kid fall down, and laughing...
but three times in a row. Thanks.
--
Christopher G. Stach II
Manish Gulati
2007-03-26 04:40:09 UTC
Permalink
And for using no persistence, use the following Url:

vm://localhost?broker.persistent=false

CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail
messages appended or attached to it, may contain information that is
confidential or legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that you must not read this
transmission and that any disclosure, copying, printing, distribution,
or use of the information contained or attached to this transmission is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender by telephone +91.172.229.9438 or
return e-mail message mgulati-7I3u/***@public.gmane.org and delete the original
transmission, its attachments, and any copies without reading or saving
in any manner. Thank you.

-----Original Message-----
From: Manish Gulati [mailto:mgulati-7I3u/***@public.gmane.org]
Sent: Monday, March 26, 2007 10:08 AM
To: users-UzBZ5Px8zVWY1pf4d8vP8EB+***@public.gmane.org
Subject: RE: Problems with VM transport

Hi,

For JournalLockedException, include activeio-core-3.0-beta4.jar (you may
have different version of this) in your classpath.

Regards,
Manish Gulati

CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail
messages appended or attached to it, may contain information that is
confidential or legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that you must not read this
transmission and that any disclosure, copying, printing, distribution,
or use of the information contained or attached to this transmission is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender by telephone +91.172.229.9438 or
return e-mail message mgulati-7I3u/***@public.gmane.org and delete the original
transmission, its attachments, and any copies without reading or saving
in any manner. Thank you.
-----Original Message-----
From: Christopher G. Stach II [mailto:cgs-***@public.gmane.org]
Sent: Monday, March 26, 2007 8:42 AM
To: users-UzBZ5Px8zVWY1pf4d8vP8EB+***@public.gmane.org
Subject: Re: Problems with VM transport
Post by u***@public.gmane.org
Hello...
I have a couple of basic questions on ActiveMQ. I would appreciate any hits as I am stuck.
I am using ActiveMQ 4.1 with JDK6.
1) When I use an embedded broker with vm transport (vm://localhost)
the instantiation of my Spring SimpleMessageListenerContainer
always fails with a JournalLockedException.
What does this exception mean exactly? I understand this has something to do with
persistance of message (since that is on by default). While I do not
care to enable persistance and would like to turn it off, I would still
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'DmmStartupMessageListener' defined in class
path resource [contexts/bus/DmsStandardSubscriptions.xml]: Invocation of
init method failed; nested exception is java.lang.NoClassDefFoundError:
org/apache/activeio/journal/active/JournalLockedException
org/apache/activeio/journal/active/JournalLockedException
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createPersistenceFactory(Broker
Service.java:1328)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getPersistenceFactory(BrokerSer
vice.java:544)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createPersistenceAdapter(Broker
Service.java:1320)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerSer
vice.java:631)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServic
e.java:1250)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java
:1209)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:50
8)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(V
MTransportFactory.java:113)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTranspor
tFactory.java:52)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactor
y.java:43)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.
java:77)
Post by u***@public.gmane.org
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQCo
nnectionFactory.java:227)
Post by u***@public.gmane.org
2) Which jarfile contains the exception class
org/apache/activeio/journal/active/JournalLockedException?
Post by u***@public.gmane.org
3) How do I use an embedded broker without persistance?
The URL
vm://localhost?persistant=false
fails with an exception that says that the option is illegal.
4) Once the broker is up, could I dynamically (programmatically) change the
broker URL by augmenting the broker URL with a failover URL as
follows?
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Thanks,
/U
This was kind of like watching a retarded kid fall down, and laughing...
but three times in a row. Thanks.
--
Christopher G. Stach II
Adrian Co
2007-03-26 16:43:50 UTC
Permalink
Post by u***@public.gmane.org
Hello...
I have a couple of basic questions on ActiveMQ. I would appreciate any hits as I am stuck.
I am using ActiveMQ 4.1 with JDK6.
1) When I use an embedded broker with vm transport (vm://localhost)
the instantiation of my Spring SimpleMessageListenerContainer
always fails with a JournalLockedException.
What does this exception mean exactly? I understand this has something to do with
persistance of message (since that is on by default). While I do not
care to enable persistance and would like to turn it off, I would still
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DmmStartupMessageListener' defined in class path resource [contexts/bus/DmsStandardSubscriptions.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/activeio/journal/active/JournalLockedException
java.lang.NoClassDefFoundError: org/apache/activeio/journal/active/JournalLockedException
at org.apache.activemq.broker.BrokerService.createPersistenceFactory(BrokerService.java:1328)
at org.apache.activemq.broker.BrokerService.getPersistenceFactory(BrokerService.java:544)
at org.apache.activemq.broker.BrokerService.createPersistenceAdapter(BrokerService.java:1320)
at org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerService.java:631)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1250)
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:113)
at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:52)
at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:43)
at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:77)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:227)
2) Which jarfile contains the exception class org/apache/activeio/journal/active/JournalLockedException?
3) How do I use an embedded broker without persistance?
The URL
vm://localhost?persistant=false
fails with an exception that says that the option is illegal.
4) Once the broker is up, could I dynamically (programmatically) change the
broker URL by augmenting the broker URL with a failover URL as follows?
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Personally, I'm not sure if you can I haven't tried it, but I don't
think it makes sense to make a vm transport failover. The assumption is
that you have a broker running in the same vm as your jms client. If the
broker crashes, it means your client *should* have crashed also and it
can't failover over to a remote broker anymore.
Post by u***@public.gmane.org
Thanks,
/U
!DSPAM:507,4606f652307602068143078!
u***@public.gmane.org
2007-03-26 19:11:04 UTC
Permalink
Adrian,

Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Personally, I'm not sure if you can I haven't tried it, but I don't
think it makes sense to make a vm transport failover. The assumption is
that you have a broker running in the same vm as your jms client. If the
broker crashes, it means your client *should* have crashed also and it
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as 'retard' :-).
I need to have the client listen to two different brokers (the embedded
and the external) at the same time (so that the client receives messages published
by both the brokers and the messages published by the client are sent to both the
brokers). Is this the correct URI to network the embedded broker with an external broker?

static:(vm://localhost,tcp://remotehost:61616)


Could you also clarify an additional question? If I instantiate multiple
connection factories in the same VM pointing to the embedded broker
would all the cconnection factories in the VM share the same broker
(as opposed to attempting to "instantiating a new embedded broker" if
such a thing were possible)?

Thanks again,

/U

-------------- Original message ----------------------
Post by Adrian Co
Post by u***@public.gmane.org
Hello...
I have a couple of basic questions on ActiveMQ. I would appreciate any hits as
I am stuck.
Post by u***@public.gmane.org
I am using ActiveMQ 4.1 with JDK6.
1) When I use an embedded broker with vm transport (vm://localhost)
the instantiation of my Spring SimpleMessageListenerContainer
always fails with a JournalLockedException.
What does this exception mean exactly? I understand this has something to do
with
Post by u***@public.gmane.org
persistance of message (since that is on by default). While I do not
care to enable persistance and would like to turn it off, I would still
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'DmmStartupMessageListener' defined in class path resource
[contexts/bus/DmsStandardSubscriptions.xml]: Invocation of init method failed;
org/apache/activeio/journal/active/JournalLockedException
org/apache/activeio/journal/active/JournalLockedException
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createPersistenceFactory(BrokerService.
java:1328)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getPersistenceFactory(BrokerService.jav
a:544)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createPersistenceAdapter(BrokerService.
java:1320)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerService.jav
a:631)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1
250)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
Post by u***@public.gmane.org
at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTranspo
rtFactory.java:113)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory
.java:52)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:4
3)
Post by u***@public.gmane.org
at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:77)
Post by u***@public.gmane.org
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnection
Factory.java:227)
Post by u***@public.gmane.org
2) Which jarfile contains the exception class
org/apache/activeio/journal/active/JournalLockedException?
Post by u***@public.gmane.org
3) How do I use an embedded broker without persistance?
The URL
vm://localhost?persistant=false
fails with an exception that says that the option is illegal.
4) Once the broker is up, could I dynamically (programmatically) change the
broker URL by augmenting the broker URL with a failover URL as follows?
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Personally, I'm not sure if you can I haven't tried it, but I don't
think it makes sense to make a vm transport failover. The assumption is
that you have a broker running in the same vm as your jms client. If the
broker crashes, it means your client *should* have crashed also and it
can't failover over to a remote broker anymore.
Post by u***@public.gmane.org
Thanks,
/U
!DSPAM:507,4606f652307602068143078!
Adrian Co
2007-03-26 19:29:45 UTC
Permalink
Post by u***@public.gmane.org
Adrian,
Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause problems?
Personally, I'm not sure if you can I haven't tried it, but I don't
think it makes sense to make a vm transport failover. The assumption is
that you have a broker running in the same vm as your jms client. If the
broker crashes, it means your client *should* have crashed also and it
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as 'retard' :-).
I need to have the client listen to two different brokers (the embedded
and the external) at the same time (so that the client receives messages published
by both the brokers and the messages published by the client are sent to both the
brokers). Is this the correct URI to network the embedded broker with an external broker?
static:(vm://localhost,tcp://remotehost:61616)
Hum. AFAIK, static just tells the client to choose one url to connect
to. I don't think you can listen to two or more brokers using a single
connection. You might want to network the brokers together if thats
possible. If someone can let me know if its possible to listen to more
than two brokers using a single jms connection, I'd appreciate it also. :-)
Post by u***@public.gmane.org
Could you also clarify an additional question? If I instantiate multiple
connection factories in the same VM pointing to the embedded broker
would all the cconnection factories in the VM share the same broker
(as opposed to attempting to "instantiating a new embedded broker" if
such a thing were possible)?
If they are in the same jvm, and there's already an embedded broker, it
will be reused.
Post by u***@public.gmane.org
Thanks again,
/U
u***@public.gmane.org
2007-03-27 03:24:20 UTC
Permalink
Hi -

I am using the embedded broker in a servlet container. Each webapp in the servlet
container instantiates a connection factory that refers to broker URL of

vm://localhost?broker.persistent=false

as follows:

(Servlet Container
(WebApp1
ConnectionFactory -> vm://localhost?broker.persistent=false
)
)

and this works fine. But as soon as I instantiate another webapp (WebApp2) that
also uses embedded broker as follows:

(Servlet Container
(WebApp1
ConnectionFactory -> vm://localhost?broker.persistent=false
)
(WebApp2
ConnectionFactory -> vm://localhost?broker.persistent=false
)
)

the second webapp fails with the JMSException given below:

javax.jms.JMSException: Could not create Transport. Reason: javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localhost,Type=Broker
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:33)
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:229)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:242)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:211)
at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:158)
at org.springframework.jms.listener.AbstractMessageListenerContainer.createConnection(AbstractMessageListenerContainer.java:989)
at org.springframework.jms.listener.AbstractMessageListenerContainer.refreshSharedConnection(AbstractMessageListenerContainer.java:455)
//...


I thought I could (tentatively) work around this problem by disabling Jmx, so I switched the
broker URL (for both webapps) to

vm://localhost?broker.persistent=false&useJmx=false

This did not help. Is there fundamentally a problem with multiple
instances of ActiveMQConnectionFactory referring to the same broker URL
(which is likely to to be the case when using embedded broker)?

Thanks,

/U


-------------- Original message ----------------------
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Adrian,
Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause
problems?
Post by u***@public.gmane.org
Post by Adrian Co
Personally, I'm not sure if you can I haven't tried it, but I don't
think it makes sense to make a vm transport failover. The assumption
is
Post by u***@public.gmane.org
Post by Adrian Co
that you have a broker running in the same vm as your jms client. If
the
Post by u***@public.gmane.org
Post by Adrian Co
broker crashes, it means your client *should* have crashed also and
it
Post by u***@public.gmane.org
Post by Adrian Co
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as 'retard' :-).
I need to have the client listen to two different brokers (the embedded
and the external) at the same time (so that the client receives messages
published
Post by u***@public.gmane.org
by both the brokers and the messages published by the client are sent to both
the
Post by u***@public.gmane.org
brokers). Is this the correct URI to network the embedded broker with an
external broker?
Post by u***@public.gmane.org
static:(vm://localhost,tcp://remotehost:61616)
Hum. AFAIK, static just tells the client to choose one url to connect
to. I don't think you can listen to two or more brokers using a single
connection. You might want to network the brokers together if thats
possible. If someone can let me know if its possible to listen to more
than two brokers using a single jms connection, I'd appreciate it also. :-)
Post by u***@public.gmane.org
Could you also clarify an additional question? If I instantiate multiple
connection factories in the same VM pointing to the embedded broker
would all the cconnection factories in the VM share the same broker
(as opposed to attempting to "instantiating a new embedded broker" if
such a thing were possible)?
If they are in the same jvm, and there's already an embedded broker, it
will be reused.
Post by u***@public.gmane.org
Thanks again,
/U
u***@public.gmane.org
2007-03-27 03:30:53 UTC
Permalink
To follow up on my last mail: I can perhaps avoid the problem by
using distinct brokernames for each webapp; but that would
create distinct embedded brokers perhaps? I need both the webapps
to share the same broker so they receive messages published
by each other.

Regards,

/U

-------------- Original message ----------------------
Post by u***@public.gmane.org
Hi -
I am using the embedded broker in a servlet container. Each webapp in the
servlet
container instantiates a connection factory that refers to broker URL of
vm://localhost?broker.persistent=false
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
and this works fine. But as soon as I instantiate another webapp (WebApp2) that
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
(WebApp2
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
org.apache.activemq:BrokerName=localhost,Type=Broker
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:33)
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnection
Factory.java:229)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQC
onnectionFactory.java:242)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQC
onnectionFactory.java:211)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectio
nFactory.java:158)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.createConnecti
on(AbstractMessageListenerContainer.java:989)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.refreshSharedC
onnection(AbstractMessageListenerContainer.java:455)
//...
I thought I could (tentatively) work around this problem by disabling Jmx, so I
switched the
broker URL (for both webapps) to
vm://localhost?broker.persistent=false&useJmx=false
This did not help. Is there fundamentally a problem with multiple
instances of ActiveMQConnectionFactory referring to the same broker URL
(which is likely to to be the case when using embedded broker)?
Thanks,
/U
-------------- Original message ----------------------
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Adrian,
Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause
problems?
Post by u***@public.gmane.org
Post by Adrian Co
Personally, I'm not sure if you can I haven't tried it, but I
don't
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by Adrian Co
think it makes sense to make a vm transport failover. The
assumption
Post by u***@public.gmane.org
is
Post by u***@public.gmane.org
Post by Adrian Co
that you have a broker running in the same vm as your jms client.
If
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
Post by Adrian Co
broker crashes, it means your client *should* have crashed also
and
Post by u***@public.gmane.org
it
Post by u***@public.gmane.org
Post by Adrian Co
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as 'retard' :-).
I need to have the client listen to two different brokers (the embedded
and the external) at the same time (so that the client receives messages
published
Post by u***@public.gmane.org
by both the brokers and the messages published by the client are sent to
both
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
brokers). Is this the correct URI to network the embedded broker with an
external broker?
Post by u***@public.gmane.org
static:(vm://localhost,tcp://remotehost:61616)
Hum. AFAIK, static just tells the client to choose one url to connect
to. I don't think you can listen to two or more brokers using a single
connection. You might want to network the brokers together if thats
possible. If someone can let me know if its possible to listen to more
than two brokers using a single jms connection, I'd appreciate it also. :-)
Post by u***@public.gmane.org
Could you also clarify an additional question? If I instantiate multiple
connection factories in the same VM pointing to the embedded broker
would all the cconnection factories in the VM share the same broker
(as opposed to attempting to "instantiating a new embedded broker" if
such a thing were possible)?
If they are in the same jvm, and there's already an embedded broker, it
will be reused.
Post by u***@public.gmane.org
Thanks again,
/U
Suchitha Koneru (sukoneru)
2007-03-27 20:19:08 UTC
Permalink
Hi ,
I also have two web apps running in Tomcat 5.5.20.Active mq
version being used is 4.0.2.
Our application uses an embedded broker, This broker is started by a
servlet context Listener, which is specified in web.xml of one of the
web apps. Both the web apps connect to this broker and exchange
messages. I am using tcp mode of transport tcp://localhost:"+portNum+ ,
for the broker.
Both the web apps connect to the broker using the url
failover:tcp://localhost:"+this.portNum

Make sure that the broker is started by a servlet context listener ,
which is part of the web app , which is started first in order. For
example , in my case I have two webapps servlets and users,
Servlets is started before users, so there by the broker is a part of
servlets web app.




Hope this helps.
Thanks,
Suchitha.




-----Original Message-----
From: uma_rk-***@public.gmane.org [mailto:uma_rk-***@public.gmane.org]
Sent: Monday, March 26, 2007 8:31 PM
To: users-UzBZ5Px8zVWY1pf4d8vP8EB+***@public.gmane.org
Subject: Re: Problems with VM transport


To follow up on my last mail: I can perhaps avoid the problem by using
distinct brokernames for each webapp; but that would create distinct
embedded brokers perhaps? I need both the webapps to share the same
broker so they receive messages published by each other.

Regards,

/U

-------------- Original message ----------------------
Post by u***@public.gmane.org
Hi -
I am using the embedded broker in a servlet container. Each webapp
in the servlet container instantiates a connection factory that refers
to broker URL of
vm://localhost?broker.persistent=false
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
and this works fine. But as soon as I instantiate another webapp
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
(WebApp2
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
org.apache.activemq:BrokerName=localhost,Type=Broker
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
java:33)
Post by u***@public.gmane.org
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQ
Connection
Factory.java:229)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection
(ActiveMQC
onnectionFactory.java:242)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection
(ActiveMQC
onnectionFactory.java:211)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveM
QConnectio
nFactory.java:158)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.crea
teConnecti
on(AbstractMessageListenerContainer.java:989)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.refr
eshSharedC
onnection(AbstractMessageListenerContainer.java:455)
//...
I thought I could (tentatively) work around this problem by disabling
Jmx, so I switched the broker URL (for both webapps) to
vm://localhost?broker.persistent=false&useJmx=false
This did not help. Is there fundamentally a problem with multiple
instances of ActiveMQConnectionFactory referring to the same broker
URL (which is likely to to be the case when using embedded broker)?
Thanks,
/U
-------------- Original message ----------------------
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Adrian,
Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection factory cause
problems?
Post by u***@public.gmane.org
Post by Adrian Co
Personally, I'm not sure if you can I haven't tried it,
but I
don't
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by Adrian Co
think it makes sense to make a vm transport failover.
The
assumption
Post by u***@public.gmane.org
is
Post by u***@public.gmane.org
Post by Adrian Co
that you have a broker running in the same vm as your jms client.
If
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
Post by Adrian Co
broker crashes, it means your client *should* have
crashed also
and
Post by u***@public.gmane.org
it
Post by u***@public.gmane.org
Post by Adrian Co
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as
'retard' :-).
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by u***@public.gmane.org
I need to have the client listen to two different brokers (the
embedded and the external) at the same time (so that the client
receives messages
published
Post by u***@public.gmane.org
by both the brokers and the messages published by the client are sent to
both
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
brokers). Is this the correct URI to network the embedded broker with an
external broker?
Post by u***@public.gmane.org
static:(vm://localhost,tcp://remotehost:61616)
Hum. AFAIK, static just tells the client to choose one url to
connect to. I don't think you can listen to two or more brokers
using a single connection. You might want to network the brokers
together if thats possible. If someone can let me know if its
possible to listen to more than two brokers using a single jms
connection, I'd appreciate it also. :-)
Post by u***@public.gmane.org
Could you also clarify an additional question? If I instantiate
multiple connection factories in the same VM pointing to the
embedded broker would all the cconnection factories in the VM
share the same broker (as opposed to attempting to "instantiating
a new embedded broker" if such a thing were possible)?
If they are in the same jvm, and there's already an embedded broker,
it will be reused.
Post by u***@public.gmane.org
Thanks again,
/U
u***@public.gmane.org
2007-03-27 21:17:21 UTC
Permalink
Suchitha,

Thanks for your help. I thought a URL of the form "tcp://<host>..." refers to
an external broker, not an embedded one? Am I mistaken?

I need to run the broker within the servlet container VM, not as a
separate process.

Thanks,

/U

-------------- Original message ----------------------
Post by Suchitha Koneru (sukoneru)
Hi ,
I also have two web apps running in Tomcat 5.5.20.Active mq
version being used is 4.0.2.
Our application uses an embedded broker, This broker is started by a
servlet context Listener, which is specified in web.xml of one of the
web apps. Both the web apps connect to this broker and exchange
messages. I am using tcp mode of transport tcp://localhost:"+portNum+ ,
for the broker.
Both the web apps connect to the broker using the url
failover:tcp://localhost:"+this.portNum
Make sure that the broker is started by a servlet context listener ,
which is part of the web app , which is started first in order. For
example , in my case I have two webapps servlets and users,
Servlets is started before users, so there by the broker is a part of
servlets web app.
Hope this helps.
Thanks,
Suchitha.
-----Original Message-----
Sent: Monday, March 26, 2007 8:31 PM
Subject: Re: Problems with VM transport
To follow up on my last mail: I can perhaps avoid the problem by using
distinct brokernames for each webapp; but that would create distinct
embedded brokers perhaps? I need both the webapps to share the same
broker so they receive messages published by each other.
Regards,
/U
-------------- Original message ----------------------
Post by u***@public.gmane.org
Hi -
I am using the embedded broker in a servlet container. Each webapp
in the servlet container instantiates a connection factory that refers
to broker URL of
vm://localhost?broker.persistent=false
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
and this works fine. But as soon as I instantiate another webapp
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
(WebApp2
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
org.apache.activemq:BrokerName=localhost,Type=Broker
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
java:33)
Post by u***@public.gmane.org
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQ
Connection
Factory.java:229)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection
(ActiveMQC
onnectionFactory.java:242)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection
(ActiveMQC
onnectionFactory.java:211)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveM
QConnectio
nFactory.java:158)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.crea
teConnecti
on(AbstractMessageListenerContainer.java:989)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.refr
eshSharedC
onnection(AbstractMessageListenerContainer.java:455)
//...
I thought I could (tentatively) work around this problem by disabling
Jmx, so I switched the broker URL (for both webapps) to
vm://localhost?broker.persistent=false&useJmx=false
This did not help. Is there fundamentally a problem with multiple
instances of ActiveMQConnectionFactory referring to the same broker
URL (which is likely to to be the case when using embedded broker)?
Thanks,
/U
-------------- Original message ----------------------
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Adrian,
Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection
factory cause
Post by u***@public.gmane.org
Post by u***@public.gmane.org
problems?
Post by u***@public.gmane.org
Post by Adrian Co
Personally, I'm not sure if you can I haven't tried it,
but I
don't
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by Adrian Co
think it makes sense to make a vm transport failover.
The
assumption
Post by u***@public.gmane.org
is
Post by u***@public.gmane.org
Post by Adrian Co
that you have a broker running in the same vm as your
jms client.
Post by u***@public.gmane.org
If
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
Post by Adrian Co
broker crashes, it means your client *should* have
crashed also
and
Post by u***@public.gmane.org
it
Post by u***@public.gmane.org
Post by Adrian Co
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as
'retard' :-).
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by u***@public.gmane.org
I need to have the client listen to two different brokers (the
embedded and the external) at the same time (so that the client
receives messages
published
Post by u***@public.gmane.org
by both the brokers and the messages published by the client are
sent to
both
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
brokers). Is this the correct URI to network the embedded broker
with an
external broker?
Post by u***@public.gmane.org
static:(vm://localhost,tcp://remotehost:61616)
Hum. AFAIK, static just tells the client to choose one url to
connect to. I don't think you can listen to two or more brokers
using a single connection. You might want to network the brokers
together if thats possible. If someone can let me know if its
possible to listen to more than two brokers using a single jms
connection, I'd appreciate it also. :-)
Post by u***@public.gmane.org
Could you also clarify an additional question? If I instantiate
multiple connection factories in the same VM pointing to the
embedded broker would all the cconnection factories in the VM
share the same broker (as opposed to attempting to "instantiating
a new embedded broker" if such a thing were possible)?
If they are in the same jvm, and there's already an embedded broker,
it will be reused.
Post by u***@public.gmane.org
Thanks again,
/U
Adrian Co
2007-03-27 22:02:49 UTC
Permalink
Yeah. tcp would refer to an external broker. Can you post the complete
stack trace?

BTW, can you try using broker.useJmx=false instead of just useJmx=false?

Is the exception occu
Post by u***@public.gmane.org
Suchitha,
Thanks for your help. I thought a URL of the form "tcp://<host>..." refers to
an external broker, not an embedded one? Am I mistaken?
I need to run the broker within the servlet container VM, not as a
separate process.
Thanks,
/U
-------------- Original message ----------------------
Post by Suchitha Koneru (sukoneru)
Hi ,
I also have two web apps running in Tomcat 5.5.20.Active mq
version being used is 4.0.2.
Our application uses an embedded broker, This broker is started by a
servlet context Listener, which is specified in web.xml of one of the
web apps. Both the web apps connect to this broker and exchange
messages. I am using tcp mode of transport tcp://localhost:"+portNum+ ,
for the broker.
Both the web apps connect to the broker using the url
failover:tcp://localhost:"+this.portNum
Make sure that the broker is started by a servlet context listener ,
which is part of the web app , which is started first in order. For
example , in my case I have two webapps servlets and users,
Servlets is started before users, so there by the broker is a part of
servlets web app.
Hope this helps.
Thanks,
Suchitha.
-----Original Message-----
Sent: Monday, March 26, 2007 8:31 PM
Subject: Re: Problems with VM transport
To follow up on my last mail: I can perhaps avoid the problem by using
distinct brokernames for each webapp; but that would create distinct
embedded brokers perhaps? I need both the webapps to share the same
broker so they receive messages published by each other.
Regards,
/U
-------------- Original message ----------------------
Post by u***@public.gmane.org
Hi -
I am using the embedded broker in a servlet container. Each webapp
in the servlet container instantiates a connection factory that refers
to broker URL of
vm://localhost?broker.persistent=false
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
and this works fine. But as soon as I instantiate another webapp
(Servlet Container
(WebApp1
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
(WebApp2
ConnectionFactory ->
vm://localhost?broker.persistent=false
)
)
org.apache.activemq:BrokerName=localhost,Type=Broker
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
java:33)
Post by u***@public.gmane.org
at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQ
Connection
Factory.java:229)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection
(ActiveMQC
onnectionFactory.java:242)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection
(ActiveMQC
onnectionFactory.java:211)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveM
QConnectio
nFactory.java:158)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.crea
teConnecti
on(AbstractMessageListenerContainer.java:989)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.refr
eshSharedC
onnection(AbstractMessageListenerContainer.java:455)
//...
I thought I could (tentatively) work around this problem by disabling
Jmx, so I switched the broker URL (for both webapps) to
vm://localhost?broker.persistent=false&useJmx=false
This did not help. Is there fundamentally a problem with multiple
instances of ActiveMQConnectionFactory referring to the same broker
URL (which is likely to to be the case when using embedded broker)?
Thanks,
/U
-------------- Original message ----------------------
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Adrian,
Thanks for the note.
Post by Adrian Co
Post by u***@public.gmane.org
Startup: vm://localhost
failover(vm://localhost,tcp://remote:61616)
Would modifying the broker URL of the connection
factory cause
Post by u***@public.gmane.org
Post by u***@public.gmane.org
problems?
Post by u***@public.gmane.org
Post by Adrian Co
Personally, I'm not sure if you can I haven't tried it,
but I
don't
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by Adrian Co
think it makes sense to make a vm transport failover.
The
assumption
Post by u***@public.gmane.org
is
Post by u***@public.gmane.org
Post by Adrian Co
that you have a broker running in the same vm as your
jms client.
Post by u***@public.gmane.org
If
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
Post by Adrian Co
broker crashes, it means your client *should* have
crashed also
and
Post by u***@public.gmane.org
it
Post by u***@public.gmane.org
Post by Adrian Co
can't failover over to a remote broker anymore.
Makes sense - now I see why someone else referred to me as
'retard' :-).
Post by u***@public.gmane.org
Post by u***@public.gmane.org
Post by u***@public.gmane.org
I need to have the client listen to two different brokers (the
embedded and the external) at the same time (so that the client
receives messages
published
Post by u***@public.gmane.org
by both the brokers and the messages published by the client are
sent to
both
Post by u***@public.gmane.org
the
Post by u***@public.gmane.org
brokers). Is this the correct URI to network the embedded broker
with an
external broker?
Post by u***@public.gmane.org
static:(vm://localhost,tcp://remotehost:61616)
Hum. AFAIK, static just tells the client to choose one url to
connect to. I don't think you can listen to two or more brokers
using a single connection. You might want to network the brokers
together if thats possible. If someone can let me know if its
possible to listen to more than two brokers using a single jms
connection, I'd appreciate it also. :-)
Post by u***@public.gmane.org
Could you also clarify an additional question? If I instantiate
multiple connection factories in the same VM pointing to the
embedded broker would all the cconnection factories in the VM
share the same broker (as opposed to attempting to "instantiating
a new embedded broker" if such a thing were possible)?
If they are in the same jvm, and there's already an embedded broker,
it will be reused.
Post by u***@public.gmane.org
Thanks again,
/U
!DSPAM:507,460989f7266458859425881!
Christopher G. Stach II
2007-03-28 01:56:57 UTC
Permalink
Post by Adrian Co
Yeah. tcp would refer to an external broker. Can you post the complete
stack trace?
BTW, can you try using broker.useJmx=false instead of just useJmx=false?
Is the exception occu
Post by u***@public.gmane.org
Suchitha,
Thanks for your help. I thought a URL of the form "tcp://<host>..." refers to
an external broker, not an embedded one? Am I mistaken?
I need to run the broker within the servlet container VM, not as a
separate process.
``tcp'' can refer to _any_ broker, local or remote, that has a TCP
transportConnector. If you run a vm broker in one webapp and expect
another webapp to talk to it, you just might run into classloader problems.
--
Christopher G. Stach II
u***@public.gmane.org
2007-03-28 05:51:36 UTC
Permalink
Post by Christopher G. Stach II
``tcp'' can refer to _any_ broker, local or remote, that has a TCP
transportConnector.
I understand; it is also my understanding that TCP transport connector
may be used only if the broker running as a distinct process - either
on the localhost or remotely. I am referring to such a broker as "external
broker" as opposed to one that uses "VM" transport and is hence 'embedded'
inside the (J)VM which defines it. Is this terminology correct?

I just saw Suchitha's response where she says that embedded brokers
may also use TCP connector. Is that possible at all?
Post by Christopher G. Stach II
If you run a vm broker in one webapp and expect
another webapp to talk to it, you just might run into classloader problems.
Does this mean that distinct webapps in a servlet container wishing to share
a broker may not use an embedded ("VM") broker?

Thanks,

/U





-------------- Original message ----------------------
Post by Christopher G. Stach II
Post by Adrian Co
Yeah. tcp would refer to an external broker. Can you post the complete
stack trace?
BTW, can you try using broker.useJmx=false instead of just useJmx=false?
Is the exception occu
Post by u***@public.gmane.org
Suchitha,
Thanks for your help. I thought a URL of the form "tcp://<host>..."
refers to
an external broker, not an embedded one? Am I mistaken?
I need to run the broker within the servlet container VM, not as a
separate process.
``tcp'' can refer to _any_ broker, local or remote, that has a TCP
transportConnector. If you run a vm broker in one webapp and expect
another webapp to talk to it, you just might run into classloader problems.
--
Christopher G. Stach II
James Strachan
2007-03-28 08:13:55 UTC
Permalink
Post by u***@public.gmane.org
Post by Christopher G. Stach II
``tcp'' can refer to _any_ broker, local or remote, that has a TCP
transportConnector.
I understand; it is also my understanding that TCP transport connector
may be used only if the broker running as a distinct process - either
on the localhost or remotely. I am referring to such a broker as "external
broker" as opposed to one that uses "VM" transport and is hence 'embedded'
inside the (J)VM which defines it. Is this terminology correct?
You can embed a broker inside the same JVM and still use TCP
Post by u***@public.gmane.org
I just saw Suchitha's response where she says that embedded brokers
may also use TCP connector. Is that possible at all?
Yes. ActiveMQ is pure Java, you can run the broker wherever you like :)
Post by u***@public.gmane.org
Post by Christopher G. Stach II
If you run a vm broker in one webapp and expect
another webapp to talk to it, you just might run into classloader problems.
Does this mean that distinct webapps in a servlet container wishing to share
a broker may not use an embedded ("VM") broker?
Correct - as they are by definition in different class loaders and so
cannot see each other. As a hack though, you could put all the
ActiveMQ classes on the system class path so that the VM broker is
shared across each web app
--
James
-------
http://radio.weblogs.com/0112098/
Continue reading on narkive:
Loading...