You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ldebello <lu...@hotmail.com> on 2019/12/13 21:19:49 UTC

Last Value Queue

Hi,

This is some kind of related to my previous question, because I am checking
different options but getting some weird behaviors.

We have an Artemis Broker 2.9.0 (Single Node - No Cluster) and doing the
following test

Queue: State (Last Value Queue)

Producer Send Message: Message(LVQ_ID="Some", Content=1, Queue=State)
Consumer Read Message: Message(LVQ_ID="Some", Content=1, Queue=State)
Consumer Wait 30 seconds

In the meanwhile:
Producer Send Message: Message(LVQ_ID="Some", Content=2, Queue=State)
Producer Send Message: Message(LVQ_ID="Some", Content=3, Queue=State)

30 seconds after
Consumer Read Message: Message(LVQ_ID="Some", Content=2, Queue=State)
Consumer Read Message: Message(LVQ_ID="Some", Content=3, Queue=State)

I was expecting consumer read Content=3 because the queue is LVQ.

Is my understanding correct?





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Last Value Queue

Posted by Justin Bertram <jb...@apache.org>.
> Is there any wait to max the number of "in delivery" message, because it
seems if I have at least one consumer connected there is no wait to make
use of LVQ.

If the consumer is connected then the broker will dispatch messages to it.
There is no way to force the broker to wait for an arbitrary amount of time
for a new "last" message before dispatching messages to the consumer and
such functionality doesn't make much sense to me anyway. If you don't want
the consumer to receive messages then simply don't attach it to the queue.

> I tried to configure "jms.prefetchPolicy.all=1" to test but it works in
the same wait.

This setting is for the OpenWire JMS client. If you want to lower the size
of the consumer's buffer for the Artemis core JMS client then you should
use, e.g. consumerWindowSize=0. Of course, this will likely negatively
impact the performance of your consumer.


Justin


On Mon, Dec 16, 2019 at 12:49 PM ldebello <lu...@hotmail.com> wrote:

> Thanks for your answer, I got your point regarding "in delivery" messages.
>
> Is there any wait to max the number of "in delivery" message, because it
> seems if I have at least one consumer connected there is no wait to make
> use
> of LVQ.
>
> I tried to configure "jms.prefetchPolicy.all=1" to test but it works in the
> same wait.
>
> so, it seems to me LVQ functionality is only valid when you are not in
> cluster and when using durable queues where no consumer can be connected to
> later connect and get messages, is that correct?
>
> Thanks & Regards,
> Luis
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
>

Re: Last Value Queue

Posted by ldebello <lu...@hotmail.com>.
Thanks for your answer, I got your point regarding "in delivery" messages.

Is there any wait to max the number of "in delivery" message, because it
seems if I have at least one consumer connected there is no wait to make use
of LVQ.

I tried to configure "jms.prefetchPolicy.all=1" to test but it works in the
same wait.

so, it seems to me LVQ functionality is only valid when you are not in
cluster and when using durable queues where no consumer can be connected to
later connect and get messages, is that correct?

Thanks & Regards,
Luis



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Last Value Queue

Posted by Justin Bertram <jb...@apache.org>.
It looks to me like the consumer active while messages are being sent to
the queue. If that's the case then you're seeing the expected behavior
because even though the consumer isn't actually calling receive() or
whatever the broker is still dispatching messages to it in the background
when they arrive in the queue. That means those messages will be "in
delivery" from the broker's point of view and cannot be replaced by the
last-value semantics.


Justin

On Fri, Dec 13, 2019 at 3:13 PM ldebello <lu...@hotmail.com> wrote:

> Hi,
>
> This is some kind of related to my previous question, because I am checking
> different options but getting some weird behaviors.
>
> We have an Artemis Broker 2.9.0 (Single Node - No Cluster) and doing the
> following test
>
> Queue: State (Last Value Queue)
>
> Producer Send Message: Message(LVQ_ID="Some", Content=1, Queue=State)
> Consumer Read Message: Message(LVQ_ID="Some", Content=1, Queue=State)
> Consumer Wait 30 seconds
>
> In the meanwhile:
> Producer Send Message: Message(LVQ_ID="Some", Content=2, Queue=State)
> Producer Send Message: Message(LVQ_ID="Some", Content=3, Queue=State)
>
> 30 seconds after
> Consumer Read Message: Message(LVQ_ID="Some", Content=2, Queue=State)
> Consumer Read Message: Message(LVQ_ID="Some", Content=3, Queue=State)
>
> I was expecting consumer read Content=3 because the queue is LVQ.
>
> Is my understanding correct?
>
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
>