You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by raster3 <cr...@yahoo.co.in> on 2016/07/28 10:06:01 UTC

kill -9 in message listener

Hi, 
Lets say there are 2 similar message listeners in two different jvms. 
They receive numbers as text messages. 
in 1st listener 3 will cause a Kill -9 of the listener process using
Processbuilder and some means to detect process id.
In 2nd listener 4 will cause  a Kill -9 of the listener process using
Processbuilder and some means to detect process id.
if kill -9 is executed in one listener (when message or rather its thread is
inside the listener method) is it safe to assume the message will be
received by the other listener?  Or will this message be lost?

Thanks. 
Raster



--
View this message in context: http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: kill -9 in message listener

Posted by artnaseef <ar...@amlinv.com>.
OK, persistent messages to a queue I expect to always be redelivered after
a missing acknowledgement on a dropped connection.

If a repeatable missing message redelivery in this case can be
demonstrated, I would be interested to look at the code.

As mentioned above, timing comes into play, and it is possible that the
message will be redelivered later than expected (redeliveries may not
maintain ordering).


On Fri, Sep 2, 2016 at 11:46 AM, raster3 [via ActiveMQ] <
ml-node+s2283324n4716116h44@n4.nabble.com> wrote:

> Yes they are to a queue.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://activemq.2283324.n4.nabble.com/kill-9-in-message-
> listener-tp4714620p4716116.html
> To start a new topic under ActiveMQ - User, email
> ml-node+s2283324n2341805h3@n4.nabble.com
> To unsubscribe from ActiveMQ - User, click here
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2341805&code=YXJ0QGFtbGludi5jb218MjM0MTgwNXwyMDc3NjQwODU5>
> .
> NAML
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620p4716117.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: kill -9 in message listener

Posted by raster3 <cr...@yahoo.co.in>.
Yes they are to a queue.




--
View this message in context: http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620p4716116.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: kill -9 in message listener

Posted by artnaseef <ar...@amlinv.com>.
Normally, the operation of message acknowledgement and redelivery should
have nothing to do with publisher settings.  With that said, there are some
broker configurations that change operation in non-obvious ways, such as
the "optimized dispatch" option.

Are these persistent messages delivered to a Queue?

On Thu, Sep 1, 2016 at 10:13 AM, raster3 [via ActiveMQ] <
ml-node+s2283324n4716060h8@n4.nabble.com> wrote:

> Got it to work when using spring boot at both sender and listener.
> Is there anything I must do to make it work when sender is in plain java
> without spring but listener is using spring boot
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://activemq.2283324.n4.nabble.com/kill-9-in-message-
> listener-tp4714620p4716060.html
> To start a new topic under ActiveMQ - User, email
> ml-node+s2283324n2341805h3@n4.nabble.com
> To unsubscribe from ActiveMQ - User, click here
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2341805&code=YXJ0QGFtbGludi5jb218MjM0MTgwNXwyMDc3NjQwODU5>
> .
> NAML
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620p4716068.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: kill -9 in message listener

Posted by raster3 <cr...@yahoo.co.in>.
Got it to work when using spring boot at both sender and listener.
Is there anything I must do to make it work when sender is in plain java
without spring but listener is using spring boot



--
View this message in context: http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620p4716060.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: kill -9 in message listener

Posted by raster3 <cr...@yahoo.co.in>.
Hi,

Sorry for late reply.
So what will happen when the listener is in a JMS transaction?
How do I control this timeout?
Where is this wiki?

Raster 



--
View this message in context: http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620p4716051.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: kill -9 in message listener

Posted by Tim Bain <tb...@alumni.duke.edu>.
The message will only be delivered to another consumer if it hasn't yet
been acknowledged.  And whether that has happened at the point your process
dies depends on what your acknowledgement mode is.  The default is
auto-ack, where a message is acked as soon as it is delivered to a
consumer, even if it hasn't been successfully processed.  But there are
other acknowledgement modes, as well as transactions, and the behavior
you'll see depends on exactly which options you're using.  The wiki has
lots more detail about both acknowledgement modes and transactions.

Keep in mind that a kill -9 will sever TCP connections without cleanly
shutting them down, so the remote (broker) end won't close until the
timeout expires, which can lead to undesirable effects in some
circumstances. So think about whether what you're doing is actually the
right choice, compared to calling System.exit() or something similar.

Tim

On Jul 28, 2016 4:50 AM, "raster3" <cr...@yahoo.co.in> wrote:

> Hi,
> Lets say there are 2 similar message listeners in two different jvms.
> They receive numbers as text messages.
> in 1st listener 3 will cause a Kill -9 of the listener process using
> Processbuilder and some means to detect process id.
> In 2nd listener 4 will cause  a Kill -9 of the listener process using
> Processbuilder and some means to detect process id.
> if kill -9 is executed in one listener (when message or rather its thread
> is
> inside the listener method) is it safe to assume the message will be
> received by the other listener?  Or will this message be lost?
>
> Thanks.
> Raster
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/kill-9-in-message-listener-tp4714620.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>