activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <tb...@alumni.duke.edu>
Subject Re: Simulating loss of broker publisher connectivity
Date Sat, 14 May 2016 02:53:10 GMT
Publishers can't enqueue messages locally without a broker.  No broker, no
work done.

However, it's possible to embed a broker within the producer process, which
would then connect to the external broker when available and buffer
messages when the connection is broken.  But this adds complexity to your
configuration and you need to think about what you want to happen when the
producer process (and its embedded broker) are stopped.  Only go down this
path if you need the ability to continue producing messages when a
connection to the broker is unavailable; if you don't truly need that, it's
not worth the effort you'll put into it.

Tim
On May 13, 2016 12:30 PM, "Jiri Danek" <jdanek@redhat.com> wrote:

On Fri, May 13, 2016 at 9:44 AM, siddutta <siddhartha_dutta@live.com> wrote:

> I wish to run an experiment in which the publisher loses connection with
> the
> broker and then enqueues them in its own queue and then when it regains
> connectivity it send s all its queued messages to the broker. How can I I
> do
> this since if I call close connection, I can no longer send(raises an
> exception). A trick that I can think of is to use a network of two brokers
> and simulate the above by breaking the connection between the two brokers.
> Is there an API call that I can use to do the above?
>

You could try sending a SIGSTOP signal to the broker process, wait for a
while, and then send it a SIGCONT. If the broker is running in a terminal,
you can do Ctrl+z to pause it and then fg to resume it. If you do this,
connection stays open, but broker stops responding. I believe that from the
point of view of the publisher, this is indistinguishable from a network
failure between the publisher and the router.
 --
Jiří Daněk

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