You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by johnd <jl...@gmail.com> on 2014/01/20 18:44:48 UTC

How to use embedded and standalone broker bridged together?

Hi,

I am having some problems setting-up an embedded broker to work correctly
with a standalone broker via a static bridge - messages are getting lost. I
am new to activeMQ so this is probably either a misunderstanding on my part
or configuration problem.

I have a standalone activeMQ instance which routes messages on a topic to
various client-specific queues. To enable the webapp to work when this
standalone instance is down, I have also set-up an embedded broker in the
webapp. The idea here is to allow the app to generate and send events to the
local broker (using vm transport) and to have these picked-up and routed via
the standalone broker, when it is active.

Everything seems to work ok, but messages sent to the local broker when the
standalone is down are not forwarded to the standalone broker when it is
started. Is this the expected behaviour? How can I set things up so that I
do not loose these messages/events when the standalone is down?

Config of standalone broker (currently using kahaDB for persistence):



Config of embedded broker  (currently using JDBC with postgres for
persistence):





--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-use-embedded-and-standalone-broker-bridged-together-tp4676540.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to use embedded and standalone broker bridged together?

Posted by artnaseef <ar...@artnaseef.com>.
Awesome - you're welcome.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-use-embedded-and-standalone-broker-bridged-together-tp4676540p4676786.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to use embedded and standalone broker bridged together?

Posted by johnd <jl...@gmail.com>.
artnaseef wrote
> Is the embedded broker looking for messages on the Topic?

Yes.


artnaseef wrote
> Keep in mind messages sent to a Topic are only ever dispatched to either
> active subscriptions, or durable subscriptions.  In fact, the broker never
> stores messages for a Topic, but instead stores them in the Topic
> subscriptions, which highlights the fact that a client coming in to
> consume from a Topic with a Non-Durable subscription won't have any past
> messages to consume.
> 
> So, if the webapp is consuming from the Topic, then it will miss messages
> while it is away.
> 
> If that's not the case, it would help to have a concise description of the
> destination flow.

The subscriptions on the topic are/were set to be durable.

As I couldn't get this to work, I switched to using a queue across the
bridge rather than a topic. This worked better but I had further problems
which I posted under the subject 'Persistent messages moving to DLQ when
consumer not active'. This turned out to be due to the use of the
TimeStampingBrokerPlugin (which you kindly pointed out). I removed this
plugin from the xml config and the messages were no longer moved to the DLQ. 

I have now switched back to using a topic over the bridge and again things
are working as expected. I think therefore it may have been the use of the
TimeStampingBrokerPlugin whited caused this problem, although I can't be
sure.

Anyway, problem resolved. Thanks for you help.

Regards,

John.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-use-embedded-and-standalone-broker-bridged-together-tp4676540p4676766.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to use embedded and standalone broker bridged together?

Posted by artnaseef <ar...@artnaseef.com>.
Is the embedded broker looking for messages on the Topic?

Keep in mind messages sent to a Topic are only ever dispatched to either
active subscriptions, or durable subscriptions.  In fact, the broker never
stores messages for a Topic, but instead stores them in the Topic
subscriptions, which highlights the fact that a client coming in to consume
from a Topic with a Non-Durable subscription won't have any past messages to
consume.

So, if the webapp is consuming from the Topic, then it will miss messages
while it is away.

If that's not the case, it would help to have a concise description of the
destination flow.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-use-embedded-and-standalone-broker-bridged-together-tp4676540p4676727.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.