RE: Broker redelivery - NACK and authorization issue

2023-04-04 Thread CASAUX Nicolas
FYI, I reproduced the case with ActiveMQ 5.17.4, I will open a JIRA tomorrow.

Nicolas


C2 – Usage restreint

-Message d'origine-
De : CASAUX Nicolas
Envoyé : mardi 4 avril 2023 17:59
À : users@activemq.apache.org
Objet : RE: Broker redelivery - NACK and authorization issue

Thank you Matt,

I'll try to reproduce it in a simple way, with a 5.17.x version of ActiveMQ, 
and open a JIRA.

Nicolas


C2 – Usage restreint

-Message d'origine-
De : Matt Pavlovich  Envoyé : mardi 4 avril 2023 17:06 À : 
users@activemq.apache.org Objet : Re: Broker redelivery - NACK and 
authorization issue

Hi Nicolas-

No, a ’NACK’ should not count as a ‘write’ to the queue. However, we need 
additional detail (and preferably a reproducible unit test) to confirm it is a 
bug, or configuration issue.

Please create a JIRA (https://issues.apache.org/jira), and include your unit 
test and activemq.xml configuration.

Thanks,
Matt Pavlovich

> On Apr 4, 2023, at 9:24 AM, CASAUX Nicolas  
> wrote:
>
> Hello ActiveMQ users,
>
> I have a question regarding ActiveMQ 5.16.x and redelivery of messages.
> I set up the broker with the configuration described in paragraph “Broker 
> Redelivery” of page 
> https://activemq.apache.org/message-redelivery-and-dlq-handling .
>
> The client “abc” of the broker has a read only access to a queue which is 
> dedicated to him (It’s a queue based on a topic, hence named like 
> “Consumer.abc.VirtualTopic.xxx”).
> The issue is that, when the client sends a “NACK” command over Stomp over 
> Websocket, the broker fails saying user “abc” has is not authorized to write 
> to the queue “Consumer.abc.VirtualTopic.xxx”, which is correct.
>
> My question is: is that the expected behaviour ? To be able to use a NACK 
> command, you need to be allowed to write to the queue ?
>
> Thanks in advance for your guidance 
>
> Nicolas
>
>
>
> C2 – Usage restreint


RE: Broker redelivery - NACK and authorization issue

2023-04-04 Thread CASAUX Nicolas
Thank you Matt,

I'll try to reproduce it in a simple way, with a 5.17.x version of ActiveMQ, 
and open a JIRA.

Nicolas


C2 – Usage restreint

-Message d'origine-
De : Matt Pavlovich 
Envoyé : mardi 4 avril 2023 17:06
À : users@activemq.apache.org
Objet : Re: Broker redelivery - NACK and authorization issue

Hi Nicolas-

No, a ’NACK’ should not count as a ‘write’ to the queue. However, we need 
additional detail (and preferably a reproducible unit test) to confirm it is a 
bug, or configuration issue.

Please create a JIRA (https://issues.apache.org/jira), and include your unit 
test and activemq.xml configuration.

Thanks,
Matt Pavlovich

> On Apr 4, 2023, at 9:24 AM, CASAUX Nicolas  
> wrote:
>
> Hello ActiveMQ users,
>
> I have a question regarding ActiveMQ 5.16.x and redelivery of messages.
> I set up the broker with the configuration described in paragraph “Broker 
> Redelivery” of page 
> https://activemq.apache.org/message-redelivery-and-dlq-handling .
>
> The client “abc” of the broker has a read only access to a queue which is 
> dedicated to him (It’s a queue based on a topic, hence named like 
> “Consumer.abc.VirtualTopic.xxx”).
> The issue is that, when the client sends a “NACK” command over Stomp over 
> Websocket, the broker fails saying user “abc” has is not authorized to write 
> to the queue “Consumer.abc.VirtualTopic.xxx”, which is correct.
>
> My question is: is that the expected behaviour ? To be able to use a NACK 
> command, you need to be allowed to write to the queue ?
>
> Thanks in advance for your guidance 
>
> Nicolas
>
>
>
> C2 – Usage restreint


Re: Broker redelivery - NACK and authorization issue

2023-04-04 Thread Matt Pavlovich
Hi Nicolas-

No, a ’NACK’ should not count as a ‘write’ to the queue. However, we need 
additional detail (and preferably a reproducible unit test) to confirm it is a 
bug, or configuration issue. 

Please create a JIRA (https://issues.apache.org/jira), and include your unit 
test and activemq.xml configuration.

Thanks,
Matt Pavlovich

> On Apr 4, 2023, at 9:24 AM, CASAUX Nicolas  
> wrote:
> 
> Hello ActiveMQ users,
> 
> I have a question regarding ActiveMQ 5.16.x and redelivery of messages.
> I set up the broker with the configuration described in paragraph “Broker 
> Redelivery” of page 
> https://activemq.apache.org/message-redelivery-and-dlq-handling .
> 
> The client “abc” of the broker has a read only access to a queue which is 
> dedicated to him (It’s a queue based on a topic, hence named like 
> “Consumer.abc.VirtualTopic.xxx”).
> The issue is that, when the client sends a “NACK” command over Stomp over 
> Websocket, the broker fails saying user “abc” has is not authorized to write 
> to the queue “Consumer.abc.VirtualTopic.xxx”, which is correct.
> 
> My question is: is that the expected behaviour ? To be able to use a NACK 
> command, you need to be allowed to write to the queue ?
> 
> Thanks in advance for your guidance 
> 
> Nicolas
> 
> 
> 
> C2 – Usage restreint



Broker redelivery - NACK and authorization issue

2023-04-04 Thread CASAUX Nicolas
Hello ActiveMQ users,

I have a question regarding ActiveMQ 5.16.x and redelivery of messages.
I set up the broker with the configuration described in paragraph “Broker 
Redelivery” of page 
https://activemq.apache.org/message-redelivery-and-dlq-handling .

The client “abc” of the broker has a read only access to a queue which is 
dedicated to him (It’s a queue based on a topic, hence named like 
“Consumer.abc.VirtualTopic.xxx”).
The issue is that, when the client sends a “NACK” command over Stomp over 
Websocket, the broker fails saying user “abc” has is not authorized to write to 
the queue “Consumer.abc.VirtualTopic.xxx”, which is correct.

My question is: is that the expected behaviour ? To be able to use a NACK 
command, you need to be allowed to write to the queue ?

Thanks in advance for your guidance 

Nicolas



C2 – Usage restreint


Re: Broker redelivery..

2022-03-10 Thread Endre Stølsvik
I believe the *prefetch* for queues and topics actually work this way: If
you *have not set* anything on the client, i.e. using the default, then it
will be controlled by the server. You may thus override it on the client
(with a prefetch policy on the connection factory), but get defaults from
server (with the prefetch policies set there). At least this is how I've
come to understand the documentation.

This broker redelivery solution/implementation actually feels like a hack;
Not being present from the initial design, and then hacked on later.

But while researching this, I found that I can achieve what I want by using
connectionFactory.setNonBlockingRedelivery(true). Who would have known..

Thanks,
Kind regards,
Endre.




On Wed, Mar 9, 2022 at 2:01 PM Tim Bain  wrote:

> I don't know this code nor the history behind the design decision, but this
> behavior is what I would have expected.
>
> What you're doing (if server side, then no client side) is probably the
> typical case, and in that case it would be beneficial to have it get
> defaulted automatically. But I'm not convinced that it's invalid to have
> non-zero values for both, and what you're proposing is more complicated to
> implement (have to make the protocol pass the server value to the client,
> then have to track whether the client explicitly specified a value and
> override it only if not specified explicitly, and have to document that
> clients using the default value may find the value they're using
> automatically changes based on server configuration that might change later
> so if they want to be sure of their behavior then they should set the value
> explicitly and not use the feature).
>
> So while what you hoped for is possible, the current behavior is what I'd
> have expected.
>
> Tim
>
> On Tue, Mar 8, 2022, 1:49 PM Endre Stølsvik  wrote:
>
> > Hi!
> >
> > Trying to set up broker redelivery, and was wondered really much on how
> > that interacts with the default client side redelivery.
> >
> > And now I seem to know, and this was pretty strange: You get both?!
> >
> > So, with setMaximumRedeliveries(2) on the broker, and without doing
> > anything on the client, literally just setting up an
> > ActiveMQConnectionFactory, I seem to get 7 attempts, then new 6 attempts,
> > then 6 attempts, then DLQ.
> >
> > Breakpointing in the RedeliveryPlugin.java:143, this is confirmed: After
> > the first 7 attempts, this breakpoint is hit, and the redeliveryCount ==
> 0.
> > After the next 6, new hit, redeliveryCount == 1, and then finally after 6
> > more, redeliveryCount == 2  and DLQ.
> >
> > Is this really to be expected? Do I actually need to set 0 redeliveries
> on
> > the client connection to get proper broker controlled redelivery? I had
> > hoped that the server-side setting of redelivery would override the
> client.
> >
> > Thanks,
> > kind regards,
> > Endre.
> >
>


Re: Broker redelivery..

2022-03-09 Thread Tim Bain
I don't know this code nor the history behind the design decision, but this
behavior is what I would have expected.

What you're doing (if server side, then no client side) is probably the
typical case, and in that case it would be beneficial to have it get
defaulted automatically. But I'm not convinced that it's invalid to have
non-zero values for both, and what you're proposing is more complicated to
implement (have to make the protocol pass the server value to the client,
then have to track whether the client explicitly specified a value and
override it only if not specified explicitly, and have to document that
clients using the default value may find the value they're using
automatically changes based on server configuration that might change later
so if they want to be sure of their behavior then they should set the value
explicitly and not use the feature).

So while what you hoped for is possible, the current behavior is what I'd
have expected.

Tim

On Tue, Mar 8, 2022, 1:49 PM Endre Stølsvik  wrote:

> Hi!
>
> Trying to set up broker redelivery, and was wondered really much on how
> that interacts with the default client side redelivery.
>
> And now I seem to know, and this was pretty strange: You get both?!
>
> So, with setMaximumRedeliveries(2) on the broker, and without doing
> anything on the client, literally just setting up an
> ActiveMQConnectionFactory, I seem to get 7 attempts, then new 6 attempts,
> then 6 attempts, then DLQ.
>
> Breakpointing in the RedeliveryPlugin.java:143, this is confirmed: After
> the first 7 attempts, this breakpoint is hit, and the redeliveryCount == 0.
> After the next 6, new hit, redeliveryCount == 1, and then finally after 6
> more, redeliveryCount == 2  and DLQ.
>
> Is this really to be expected? Do I actually need to set 0 redeliveries on
> the client connection to get proper broker controlled redelivery? I had
> hoped that the server-side setting of redelivery would override the client.
>
> Thanks,
> kind regards,
> Endre.
>


Broker redelivery..

2022-03-08 Thread Endre Stølsvik
Hi!

Trying to set up broker redelivery, and was wondered really much on how
that interacts with the default client side redelivery.

And now I seem to know, and this was pretty strange: You get both?!

So, with setMaximumRedeliveries(2) on the broker, and without doing
anything on the client, literally just setting up an
ActiveMQConnectionFactory, I seem to get 7 attempts, then new 6 attempts,
then 6 attempts, then DLQ.

Breakpointing in the RedeliveryPlugin.java:143, this is confirmed: After
the first 7 attempts, this breakpoint is hit, and the redeliveryCount == 0.
After the next 6, new hit, redeliveryCount == 1, and then finally after 6
more, redeliveryCount == 2  and DLQ.

Is this really to be expected? Do I actually need to set 0 redeliveries on
the client connection to get proper broker controlled redelivery? I had
hoped that the server-side setting of redelivery would override the client.

Thanks,
kind regards,
Endre.


Re: Message group and broker redelivery

2020-06-02 Thread Justin Bertram
The broker doesn't really support dependency between messages as you seem
to need. As you know, grouped messages will be sent to the same consumer,
but as far as the broker is concerned those messages are still 100%
independent of each other. It's not clear to me why a redelivery-delay of 0
wouldn't work for you. You could always implement delays in your own
message processing code as necessary. However, if using a redelivery-delay
of 0 is not possible or desirable for whatever reason then I would go with
the second option you listed - checking the dependency order and triggering
a redelivery if the order is broken. That should eventually put the
messages in the group back into order.

The broker's behavior with regards to blocking during a redelivery delay is
not configurable. It prefers to maximize message throughput in this case.


Justin

On Tue, Jun 2, 2020 at 10:34 AM Joan Pujol  wrote:

> Ok, and if using a redelivery-delay is not an option any recommended
> way to manage it?
> My best option by now is doing a pre-processing by not enqueuing
> dependent messages and have a listener to enqueue them when it's
> dependant was processed
> Or checking before processing a message if there is another in which
> it depends, forcing the dependent message to be redelivered also,...
>
> About what you comment regarding performance, it's not a very
> high-performance environment with very high throughput. It's better to
> be resilient and have strict order guarantee and exponential backoff
> retries to cover problems with external integrations.
> And by using message-groups it allows us to only lock messages that
> are on the same message-group, while allowing another messages to
> process normally, that is exactly the use case we want.
>
> Cheers,
>
> On Tue, 2 Jun 2020 at 17:22, Justin Bertram  wrote:
> >
> > > If I had a queue with message groups is ordered guaranteed if broker
> > redeliveries are present?
> >
> > If you use a redelivery-delay > 0 then delivery order will be broken. If
> > you use a redelivery-delay of 0 then delivery order will not be broken.
> > Therefore, if you want to maintain strict order then use a
> redelivery-delay
> > of 0.
> >
> > > That is if I have: m1,m2, and m3 queued with the same group key and m2
> is
> > redelivered after 5 mins, will m3 wait or not?
> >
> > Delivery for m3 will not wait. If the broker blocked delivery of
> subsequent
> > messages on the queue during a redelivery delay that would significantly
> > impact message throughput performance in a negative way. This would not
> be
> > tenable for an enterprise message broker serving hundreds or perhaps
> > thousands of clients each of whom may regularly be triggering
> redeliveries
> > on shared queues.
> >
> >
> > Justin
> >
> > On Tue, Jun 2, 2020 at 10:04 AM Joan Pujol  wrote:
> >
> > > ActiveMQ Artemis
> > >
> > > On Tue, 2 Jun 2020 at 16:22, Justin Bertram 
> wrote:
> > > >
> > > > Are you asking about ActiveMQ 5.x or ActiveMQ Artemis?
> > > >
> > > >
> > > > Justin
> > > >
> > > > On Tue, Jun 2, 2020 at 9:19 AM Joan Pujol 
> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Searching in mailing list archives for message group and message
> > > > > redelivery I've seen different responses and it's not clear to me
> the
> > > > > supposed way to work.
> > > > >
> > > > > If I had a queue with message groups is ordered guaranteed if
> broker
> > > > > redeliveries are present?
> > > > >
> > > > > That is if I have:
> > > > > m1,m2, and m3 queued with the same group key and m2 is redelivered
> > > > > after 5 mins, will m3 wait or not?
> > > > > If not, is there someone with this use case implying message order
> and
> > > > > redelivery, and can explain how it manages it?
> > > > >
> > > > > A lot of thanks in advance,
> > > > > --
> > > > > Joan Jesús Pujol Espinar
> > > > >
> > > > >
> > >
> > >
> > >
> > > --
> > > Joan Jesús Pujol Espinar
> > > http://www.joanpujol.cat
> > > https://play.google.com/store/apps/developer?id=lujop=ca
> > >
> > > --
> > > Joan Jesús Pujol Espinar
> > > http://www.joanpujol.cat
> > > http://lujop.deviantart.com
> > >
> > >
>
>
>
> --
> Joan Jesús Pujol Espinar
> http://www.joanpujol.cat
> https://play.google.com/store/apps/developer?id=lujop=ca
>
> --
> Joan Jesús Pujol Espinar
> http://www.joanpujol.cat
> http://lujop.deviantart.com
>
>


Re: Message group and broker redelivery

2020-06-02 Thread Joan Pujol
Ok, and if using a redelivery-delay is not an option any recommended
way to manage it?
My best option by now is doing a pre-processing by not enqueuing
dependent messages and have a listener to enqueue them when it's
dependant was processed
Or checking before processing a message if there is another in which
it depends, forcing the dependent message to be redelivered also,...

About what you comment regarding performance, it's not a very
high-performance environment with very high throughput. It's better to
be resilient and have strict order guarantee and exponential backoff
retries to cover problems with external integrations.
And by using message-groups it allows us to only lock messages that
are on the same message-group, while allowing another messages to
process normally, that is exactly the use case we want.

Cheers,

On Tue, 2 Jun 2020 at 17:22, Justin Bertram  wrote:
>
> > If I had a queue with message groups is ordered guaranteed if broker
> redeliveries are present?
>
> If you use a redelivery-delay > 0 then delivery order will be broken. If
> you use a redelivery-delay of 0 then delivery order will not be broken.
> Therefore, if you want to maintain strict order then use a redelivery-delay
> of 0.
>
> > That is if I have: m1,m2, and m3 queued with the same group key and m2 is
> redelivered after 5 mins, will m3 wait or not?
>
> Delivery for m3 will not wait. If the broker blocked delivery of subsequent
> messages on the queue during a redelivery delay that would significantly
> impact message throughput performance in a negative way. This would not be
> tenable for an enterprise message broker serving hundreds or perhaps
> thousands of clients each of whom may regularly be triggering redeliveries
> on shared queues.
>
>
> Justin
>
> On Tue, Jun 2, 2020 at 10:04 AM Joan Pujol  wrote:
>
> > ActiveMQ Artemis
> >
> > On Tue, 2 Jun 2020 at 16:22, Justin Bertram  wrote:
> > >
> > > Are you asking about ActiveMQ 5.x or ActiveMQ Artemis?
> > >
> > >
> > > Justin
> > >
> > > On Tue, Jun 2, 2020 at 9:19 AM Joan Pujol  wrote:
> > >
> > > > Hi,
> > > >
> > > > Searching in mailing list archives for message group and message
> > > > redelivery I've seen different responses and it's not clear to me the
> > > > supposed way to work.
> > > >
> > > > If I had a queue with message groups is ordered guaranteed if broker
> > > > redeliveries are present?
> > > >
> > > > That is if I have:
> > > > m1,m2, and m3 queued with the same group key and m2 is redelivered
> > > > after 5 mins, will m3 wait or not?
> > > > If not, is there someone with this use case implying message order and
> > > > redelivery, and can explain how it manages it?
> > > >
> > > > A lot of thanks in advance,
> > > > --
> > > > Joan Jesús Pujol Espinar
> > > >
> > > >
> >
> >
> >
> > --
> > Joan Jesús Pujol Espinar
> > http://www.joanpujol.cat
> > https://play.google.com/store/apps/developer?id=lujop=ca
> >
> > --
> > Joan Jesús Pujol Espinar
> > http://www.joanpujol.cat
> > http://lujop.deviantart.com
> >
> >



-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
https://play.google.com/store/apps/developer?id=lujop=ca

-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
http://lujop.deviantart.com


Re: Message group and broker redelivery

2020-06-02 Thread Justin Bertram
> If I had a queue with message groups is ordered guaranteed if broker
redeliveries are present?

If you use a redelivery-delay > 0 then delivery order will be broken. If
you use a redelivery-delay of 0 then delivery order will not be broken.
Therefore, if you want to maintain strict order then use a redelivery-delay
of 0.

> That is if I have: m1,m2, and m3 queued with the same group key and m2 is
redelivered after 5 mins, will m3 wait or not?

Delivery for m3 will not wait. If the broker blocked delivery of subsequent
messages on the queue during a redelivery delay that would significantly
impact message throughput performance in a negative way. This would not be
tenable for an enterprise message broker serving hundreds or perhaps
thousands of clients each of whom may regularly be triggering redeliveries
on shared queues.


Justin

On Tue, Jun 2, 2020 at 10:04 AM Joan Pujol  wrote:

> ActiveMQ Artemis
>
> On Tue, 2 Jun 2020 at 16:22, Justin Bertram  wrote:
> >
> > Are you asking about ActiveMQ 5.x or ActiveMQ Artemis?
> >
> >
> > Justin
> >
> > On Tue, Jun 2, 2020 at 9:19 AM Joan Pujol  wrote:
> >
> > > Hi,
> > >
> > > Searching in mailing list archives for message group and message
> > > redelivery I've seen different responses and it's not clear to me the
> > > supposed way to work.
> > >
> > > If I had a queue with message groups is ordered guaranteed if broker
> > > redeliveries are present?
> > >
> > > That is if I have:
> > > m1,m2, and m3 queued with the same group key and m2 is redelivered
> > > after 5 mins, will m3 wait or not?
> > > If not, is there someone with this use case implying message order and
> > > redelivery, and can explain how it manages it?
> > >
> > > A lot of thanks in advance,
> > > --
> > > Joan Jesús Pujol Espinar
> > >
> > >
>
>
>
> --
> Joan Jesús Pujol Espinar
> http://www.joanpujol.cat
> https://play.google.com/store/apps/developer?id=lujop=ca
>
> --
> Joan Jesús Pujol Espinar
> http://www.joanpujol.cat
> http://lujop.deviantart.com
>
>


Re: Message group and broker redelivery

2020-06-02 Thread Joan Pujol
ActiveMQ Artemis.

On Tue, 2 Jun 2020 at 16:22, Justin Bertram  wrote:
>
> Are you asking about ActiveMQ 5.x or ActiveMQ Artemis?
>
>
> Justin
>
> On Tue, Jun 2, 2020 at 9:19 AM Joan Pujol  wrote:
>
> > Hi,
> >
> > Searching in mailing list archives for message group and message
> > redelivery I've seen different responses and it's not clear to me the
> > supposed way to work.
> >
> > If I had a queue with message groups is ordered guaranteed if broker
> > redeliveries are present?
> >
> > That is if I have:
> > m1,m2, and m3 queued with the same group key and m2 is redelivered
> > after 5 mins, will m3 wait or not?
> > If not, is there someone with this use case implying message order and
> > redelivery, and can explain how it manages it?
> >
> > A lot of thanks in advance,
> > --
> > Joan Jesús Pujol Espinar
> >
> >



-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
https://play.google.com/store/apps/developer?id=lujop=ca


Re: Message group and broker redelivery

2020-06-02 Thread Joan Pujol
ActiveMQ Artemis

On Tue, 2 Jun 2020 at 16:22, Justin Bertram  wrote:
>
> Are you asking about ActiveMQ 5.x or ActiveMQ Artemis?
>
>
> Justin
>
> On Tue, Jun 2, 2020 at 9:19 AM Joan Pujol  wrote:
>
> > Hi,
> >
> > Searching in mailing list archives for message group and message
> > redelivery I've seen different responses and it's not clear to me the
> > supposed way to work.
> >
> > If I had a queue with message groups is ordered guaranteed if broker
> > redeliveries are present?
> >
> > That is if I have:
> > m1,m2, and m3 queued with the same group key and m2 is redelivered
> > after 5 mins, will m3 wait or not?
> > If not, is there someone with this use case implying message order and
> > redelivery, and can explain how it manages it?
> >
> > A lot of thanks in advance,
> > --
> > Joan Jesús Pujol Espinar
> >
> >



-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
https://play.google.com/store/apps/developer?id=lujop=ca

-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
http://lujop.deviantart.com


Re: Message group and broker redelivery

2020-06-02 Thread Justin Bertram
Are you asking about ActiveMQ 5.x or ActiveMQ Artemis?


Justin

On Tue, Jun 2, 2020 at 9:19 AM Joan Pujol  wrote:

> Hi,
>
> Searching in mailing list archives for message group and message
> redelivery I've seen different responses and it's not clear to me the
> supposed way to work.
>
> If I had a queue with message groups is ordered guaranteed if broker
> redeliveries are present?
>
> That is if I have:
> m1,m2, and m3 queued with the same group key and m2 is redelivered
> after 5 mins, will m3 wait or not?
> If not, is there someone with this use case implying message order and
> redelivery, and can explain how it manages it?
>
> A lot of thanks in advance,
> --
> Joan Jesús Pujol Espinar
>
>


Message group and broker redelivery

2020-06-02 Thread Joan Pujol
Hi,

Searching in mailing list archives for message group and message
redelivery I've seen different responses and it's not clear to me the
supposed way to work.

If I had a queue with message groups is ordered guaranteed if broker
redeliveries are present?

That is if I have:
m1,m2, and m3 queued with the same group key and m2 is redelivered
after 5 mins, will m3 wait or not?
If not, is there someone with this use case implying message order and
redelivery, and can explain how it manages it?

A lot of thanks in advance,
-- 
Joan Jesús Pujol Espinar


Re: Broker redelivery predispatch check across consumers is not working

2018-11-03 Thread Arjen van der Meijden
Sure I created this issue: https://issues.apache.org/jira/browse/AMQ-7090

Best regards,

Arjen

On 2-11-2018 13:32, Tim Bain wrote:
> This sounds like a bug. Can one of you please submit a bug in JIRA for it?
>
> Tim
>
> On Fri, Nov 2, 2018, 3:42 AM Arjen van der Meijden  wrote:
>
>> We have roughly the same issue, did you find a solution yet?
>> We use Stomp queue consumers with which we had a message that caused a
>> crash, the consumer restarted, crashed again, etc.
>>
>> Obviously the crashing part is our responsibility, but we wanted to see
>> if we could prevent endless resends from ActiveMQ and ran into this same
>> scenario with redelivery regardless of redeliveryPolicy-rules.
>>
>> Best regards,
>>
>> Arjen
>>
>> On 30-10-2018 04:32, djdkedev wrote:
>>> Thank you for quick response.
>>>
>>> ActiveMQ Version:5.15.6
>>>
>>> I want to test the broker redelivery predispatch check, therefore
>>> jms.redeliveryPolicy.maximumRedeliveries is set to zero at consumer
>> level.
>>> Even though there is no mismatch, the redelivery counter goes beyond
>> what is
>>> set in the redelivery plugin.The message got redelivered more than 20
>> times.
>>> I observed the same behavior when
>> jms.redeliveryPolicy.maximumRedeliveries
>>> is 1 or 0 on client side.
>>> I kept it zero because
>>>
>> http://activemq.2283324.n4.nabble.com/redeliveryPlugin-seems-to-have-problems-with-defaultEntry-td4685094.html
>>> suggested to keep it zero to avoid conflict between client redelivery and
>>> broker redelivery.
>>>
>>> Message:ActiveMQTextMessage {commandId = 6, responseRequired = true,
>>> messageId = ID:T320-2881-1540869039378-6:1:1:1:1, originalDestination =
>>> null, originalTransactionId = null, producerId =
>>> ID:T320-2881-1540869039378-6:1:1:1, destination = queue://DATAITEM_QUEUE,
>>> transactionId = null, expiration = 0, timestamp = 1540869039752, arrival
>> =
>>> 0, brokerInTime = 1540869039763, brokerOutTime = 1540869640172,
>>> correlationId = ee0676b859f9af68, replyTo = null, persistent = false,
>> type =
>>> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
>>> null, compressed = false, userID = null, content =
>>> org.apache.activemq.util.ByteSequence@619a52c3, marshalledProperties =
>> null,
>>> dataStructure = null, *redeliveryCounter = 21*, size = 0, properties =
>> null,
>>> readOnlyProperties = true, readOnlyBody = true, droppable = false,
>>> jmsXGroupFirstForConsumer = false, text = Item:1,
>>> CorelationId:ee0676b859f9af68}
>>>
>>> Hope this helps.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from:
>> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html



Re: Broker redelivery predispatch check across consumers is not working

2018-11-02 Thread Tim Bain
This sounds like a bug. Can one of you please submit a bug in JIRA for it?

Tim

On Fri, Nov 2, 2018, 3:42 AM Arjen van der Meijden  We have roughly the same issue, did you find a solution yet?
> We use Stomp queue consumers with which we had a message that caused a
> crash, the consumer restarted, crashed again, etc.
>
> Obviously the crashing part is our responsibility, but we wanted to see
> if we could prevent endless resends from ActiveMQ and ran into this same
> scenario with redelivery regardless of redeliveryPolicy-rules.
>
> Best regards,
>
> Arjen
>
> On 30-10-2018 04:32, djdkedev wrote:
> > Thank you for quick response.
> >
> > ActiveMQ Version:5.15.6
> >
> > I want to test the broker redelivery predispatch check, therefore
> > jms.redeliveryPolicy.maximumRedeliveries is set to zero at consumer
> level.
> > Even though there is no mismatch, the redelivery counter goes beyond
> what is
> > set in the redelivery plugin.The message got redelivered more than 20
> times.
> > I observed the same behavior when
> jms.redeliveryPolicy.maximumRedeliveries
> > is 1 or 0 on client side.
> > I kept it zero because
> >
> http://activemq.2283324.n4.nabble.com/redeliveryPlugin-seems-to-have-problems-with-defaultEntry-td4685094.html
> > suggested to keep it zero to avoid conflict between client redelivery and
> > broker redelivery.
> >
> > Message:ActiveMQTextMessage {commandId = 6, responseRequired = true,
> > messageId = ID:T320-2881-1540869039378-6:1:1:1:1, originalDestination =
> > null, originalTransactionId = null, producerId =
> > ID:T320-2881-1540869039378-6:1:1:1, destination = queue://DATAITEM_QUEUE,
> > transactionId = null, expiration = 0, timestamp = 1540869039752, arrival
> =
> > 0, brokerInTime = 1540869039763, brokerOutTime = 1540869640172,
> > correlationId = ee0676b859f9af68, replyTo = null, persistent = false,
> type =
> > null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> > null, compressed = false, userID = null, content =
> > org.apache.activemq.util.ByteSequence@619a52c3, marshalledProperties =
> null,
> > dataStructure = null, *redeliveryCounter = 21*, size = 0, properties =
> null,
> > readOnlyProperties = true, readOnlyBody = true, droppable = false,
> > jmsXGroupFirstForConsumer = false, text = Item:1,
> > CorelationId:ee0676b859f9af68}
> >
> > Hope this helps.
> >
> >
> >
> >
> >
> > --
> > Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
> >
>


Re: Broker redelivery predispatch check across consumers is not working

2018-11-02 Thread Arjen van der Meijden
We have roughly the same issue, did you find a solution yet?
We use Stomp queue consumers with which we had a message that caused a
crash, the consumer restarted, crashed again, etc.

Obviously the crashing part is our responsibility, but we wanted to see
if we could prevent endless resends from ActiveMQ and ran into this same
scenario with redelivery regardless of redeliveryPolicy-rules.

Best regards,

Arjen

On 30-10-2018 04:32, djdkedev wrote:
> Thank you for quick response.
> 
> ActiveMQ Version:5.15.6
> 
> I want to test the broker redelivery predispatch check, therefore 
> jms.redeliveryPolicy.maximumRedeliveries is set to zero at consumer level.
> Even though there is no mismatch, the redelivery counter goes beyond what is
> set in the redelivery plugin.The message got redelivered more than 20 times.
> I observed the same behavior when jms.redeliveryPolicy.maximumRedeliveries
> is 1 or 0 on client side.
> I kept it zero because
> http://activemq.2283324.n4.nabble.com/redeliveryPlugin-seems-to-have-problems-with-defaultEntry-td4685094.html
> suggested to keep it zero to avoid conflict between client redelivery and
> broker redelivery.
> 
> Message:ActiveMQTextMessage {commandId = 6, responseRequired = true,
> messageId = ID:T320-2881-1540869039378-6:1:1:1:1, originalDestination =
> null, originalTransactionId = null, producerId =
> ID:T320-2881-1540869039378-6:1:1:1, destination = queue://DATAITEM_QUEUE,
> transactionId = null, expiration = 0, timestamp = 1540869039752, arrival =
> 0, brokerInTime = 1540869039763, brokerOutTime = 1540869640172,
> correlationId = ee0676b859f9af68, replyTo = null, persistent = false, type =
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@619a52c3, marshalledProperties = null,
> dataStructure = null, *redeliveryCounter = 21*, size = 0, properties = null,
> readOnlyProperties = true, readOnlyBody = true, droppable = false,
> jmsXGroupFirstForConsumer = false, text = Item:1,
> CorelationId:ee0676b859f9af68}
> 
> Hope this helps.
> 
> 
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
> 


Re: Broker redelivery predispatch check across consumers is not working

2018-10-29 Thread djdkedev
Thank you for quick response.

ActiveMQ Version:5.15.6

I want to test the broker redelivery predispatch check, therefore 
jms.redeliveryPolicy.maximumRedeliveries is set to zero at consumer level.
Even though there is no mismatch, the redelivery counter goes beyond what is
set in the redelivery plugin.The message got redelivered more than 20 times.
I observed the same behavior when jms.redeliveryPolicy.maximumRedeliveries
is 1 or 0 on client side.
I kept it zero because
http://activemq.2283324.n4.nabble.com/redeliveryPlugin-seems-to-have-problems-with-defaultEntry-td4685094.html
suggested to keep it zero to avoid conflict between client redelivery and
broker redelivery.

Message:ActiveMQTextMessage {commandId = 6, responseRequired = true,
messageId = ID:T320-2881-1540869039378-6:1:1:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:T320-2881-1540869039378-6:1:1:1, destination = queue://DATAITEM_QUEUE,
transactionId = null, expiration = 0, timestamp = 1540869039752, arrival =
0, brokerInTime = 1540869039763, brokerOutTime = 1540869640172,
correlationId = ee0676b859f9af68, replyTo = null, persistent = false, type =
null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@619a52c3, marshalledProperties = null,
dataStructure = null, *redeliveryCounter = 21*, size = 0, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false, text = Item:1,
CorelationId:ee0676b859f9af68}

Hope this helps.





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


Re: Broker redelivery predispatch check across consumers is not working

2018-10-29 Thread Tim Bain
Two things:

1. You have max redeliveries set to 0 for the consumers but 1 for the
broker. Is the behavior in the face of that mismatch what's in question
here? Do you get correct behavior if the settings match?

2. How many times does the message get redelivered? Your description didn't
say that explicitly, but it sounds like it was delivered twice (redelivered
once), which would be correct for the broker configuration. Is that an
accurate description of what happened?

Tim

On Mon, Oct 29, 2018, 10:19 AM djdkedev  wrote:

> Hello,
>
> I want to add the redelivery counter check at embedded broker level but
> across consumers. Once redelivery counter is exceeded then message should
> enter into DLQ. I observed that, when client terminates without sending ack
> "INDIVIDUAL_ACKNOWLEDGE" then message is redelivered to another consumer
> even though redeliver counter set into the redelivery plugin is exceeded?
> The client has set jms.redeliveryPolicy.maximumRedeliveries=0.
>
> *
> code snippet:*
> broker.setSchedulerSupport(true);
>  RedeliveryPlugin redeliveryPlugin = new
> RedeliveryPlugin();
>
>
> redeliveryPlugin.setSendToDlqIfMaxRetriesExceeded(true);
> redeliveryPlugin.setFallbackToDeadLetter(true);
>
> RedeliveryPolicy queueEntry = new
> RedeliveryPolicy();
> queueEntry.setRedeliveryDelay(1000);
> queueEntry.setInitialRedeliveryDelay(5000);
> queueEntry.setMaximumRedeliveries(1);
> queueEntry.setPreDispatchCheck(true);
> queueEntry.setDestination(new
> ActiveMQQueue());
>
> RedeliveryPolicy defaultEntry = new RedeliveryPolicy();
> defaultEntry.setInitialRedeliveryDelay(5000);
> defaultEntry.setMaximumRedeliveries(1);
> defaultEntry.setPreDispatchCheck(true);
>
> RedeliveryPolicyMap redeliveryPolicyMap = new
> RedeliveryPolicyMap();
> redeliveryPolicyMap.setDefaultEntry(defaultEntry);
>
> redeliveryPolicyMap.setRedeliveryPolicyEntries(Arrays.asList(queueEntry));
>
>
> redeliveryPlugin.setRedeliveryPolicyMap(redeliveryPolicyMap);
>
> LoggingBrokerPlugin logPlugin = new LoggingBrokerPlugin();
> logPlugin.setLogAll(true);
>
> broker.setPlugins(new BrokerPlugin[]{redeliveryPlugin,
> logPlugin});
>
> Could you please help?
>
> Thanks,
> Dhananjay
>
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>


Broker redelivery predispatch check across consumers is not working

2018-10-29 Thread djdkedev
Hello,

I want to add the redelivery counter check at embedded broker level but
across consumers. Once redelivery counter is exceeded then message should
enter into DLQ. I observed that, when client terminates without sending ack
"INDIVIDUAL_ACKNOWLEDGE" then message is redelivered to another consumer
even though redeliver counter set into the redelivery plugin is exceeded?
The client has set jms.redeliveryPolicy.maximumRedeliveries=0.

*
code snippet:*
broker.setSchedulerSupport(true);
 RedeliveryPlugin redeliveryPlugin = new 
RedeliveryPlugin();

redeliveryPlugin.setSendToDlqIfMaxRetriesExceeded(true);
redeliveryPlugin.setFallbackToDeadLetter(true);

RedeliveryPolicy queueEntry = new RedeliveryPolicy();
queueEntry.setRedeliveryDelay(1000);
queueEntry.setInitialRedeliveryDelay(5000);
queueEntry.setMaximumRedeliveries(1);
queueEntry.setPreDispatchCheck(true);
queueEntry.setDestination(new 
ActiveMQQueue());

RedeliveryPolicy defaultEntry = new RedeliveryPolicy();
defaultEntry.setInitialRedeliveryDelay(5000);
defaultEntry.setMaximumRedeliveries(1);
defaultEntry.setPreDispatchCheck(true);

RedeliveryPolicyMap redeliveryPolicyMap = new
RedeliveryPolicyMap();
redeliveryPolicyMap.setDefaultEntry(defaultEntry);
   
redeliveryPolicyMap.setRedeliveryPolicyEntries(Arrays.asList(queueEntry));

redeliveryPlugin.setRedeliveryPolicyMap(redeliveryPolicyMap);

LoggingBrokerPlugin logPlugin = new LoggingBrokerPlugin();
logPlugin.setLogAll(true);

broker.setPlugins(new BrokerPlugin[]{redeliveryPlugin, 
logPlugin});

Could you please help?

Thanks,
Dhananjay





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


Re: Broker redelivery - messages lost on broker restart

2018-04-22 Thread j.kupka
Thanks for the reply. I tried version 5.14.5, since I am limited to java 7,
and now it's working as expected.



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


Re: Broker redelivery - messages lost on broker restart

2018-04-20 Thread Timothy Bish


5.8.0 is quite old, try moving to a new broker release.

On 04/20/2018 02:30 PM, j.kupka wrote:

Hello,

I cofigured redelivery policy through Redelivery plugin. Everything works as
expected except the scenario when the broker is restarted while there are
messages scheduled for re-delivery. Those messages are getting lost, they
are nowhere to be found, not in primary queue or DLQ. I am using persistent
delivery mode for all messages, vm transport (boker, producers and consumers
all run in the same JVM). AMQ version 5.8.0. I thought it is the
responsibility of jobSchedulerStore to save pending jobs so they survive
restart, but the log says no jobs are firing after the broker starts. I
checked the scheduler store directory, there are some files there and they
are being updated while broker is running, but I'm not sure what is stored
in them. Is there any configuration option I could try, or is this the
expected behaviour? Thanks.
Here is my broker configuration:
   http://activemq.apache.org/schema/core;
brokerName="localhost2"
persistent="true"
 schedulerSupport="true"
 useJmx="true"
 enableStatistics="true">
 
 

   
 

 
   
 
   
 
   
 
 
 

   
 
 
 

   
   
   
sendToDlqIfMaxRetriesExceeded="true">
 
   
 
   
 

 
   
 
   
 
   
 
   



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



--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/



Broker redelivery - messages lost on broker restart

2018-04-20 Thread j.kupka
Hello,

I cofigured redelivery policy through Redelivery plugin. Everything works as
expected except the scenario when the broker is restarted while there are
messages scheduled for re-delivery. Those messages are getting lost, they
are nowhere to be found, not in primary queue or DLQ. I am using persistent
delivery mode for all messages, vm transport (boker, producers and consumers
all run in the same JVM). AMQ version 5.8.0. I thought it is the
responsibility of jobSchedulerStore to save pending jobs so they survive
restart, but the log says no jobs are firing after the broker starts. I
checked the scheduler store directory, there are some files there and they
are being updated while broker is running, but I'm not sure what is stored
in them. Is there any configuration option I could try, or is this the
expected behaviour? Thanks.
Here is my broker configuration:
  http://activemq.apache.org/schema/core;
brokerName="localhost2"
persistent="true"
schedulerSupport="true"
useJmx="true"
enableStatistics="true">


  



  

  

  



  



  
  
  

  

  



  

  

  

  



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


Broker redelivery not working

2016-03-11 Thread THMayr
Hi,

I deployed a MDB on WildFliy 10.0.0 and WebLogic 12c (not at the same time)
and connected it to an ActiveMQ queue. Now I tried to define redelivery of
messages using the /redelivery-plugin/ as described here:  Broker Redelivery
(v5.7) <http://activemq.apache.org/message-redelivery-and-dlq-handling.html> 
. I set the /maximumRedeliveries /to zero, but I get always 6 re-deliveres
when message processing fails in the MDB. My configuration looks like this:



In the MDB I set the EJB context to rollback
(/MessageDrivenContext.setRollbackOnly()/). This works well, when I set the
/activation-config-property/ /maximumRedeliveries /of the MDB (WildFly) or
when I add the connection option /jms.redeliveryPolicy.maximumRedeliveries/
to the broker URI (WebLogic). The messages are redirected to the DLQ after
the first attempt.

In WebLogic I cannot set /maximumRedeliveries/ in the /activation-config/ of
the MDB, because no ActiveMQ resource adapter is envolved. So is there a
way, to specify the redelivery properties at least on a per queue base in
this case? Perhaps with another undocumented JNDI parameter for the 
ActiveMQInitialConnectionFactory?

Thanks for hints

Thomas



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Broker-redelivery-not-working-tp4709185.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Redelivery policy concerns / questions (conumer based vs broker redelivery)

2014-10-26 Thread Marek Dominiak
Hi guys,

I would like to clarify my understanding of redelivery policy types and
different ways of configuring them.

Questions:
1. Is my only option to set redelivery policy per destination basis is to
set it on the connection itself? (for blocking redelivery)


2. Can the broker redelivery be configured to be blocking? (maintaining the
processing order of messages in the queue)


3. If consumer based redelivery policy is defined on the connection for a
queue A and at the same time broker redelivery is set for this queue, which
one will be used? The consumer based or maybe broker based? Or both?


4. If I were to set redelivery policy on the connection itself - can I set
many different redelivery policy entries for different destination? I could
use this to set all redelivery policy entries in a ActiveMQConnection taken
from PooledConnection to be able to use PooledConnectionFactory instead of
ActiveMQConnectionFactory. Or should I rather use ActiveMQConnectionFactory
instead of PooledConnectionFactory (e.g. with Spring DMLC extension)?


5. If I were to set the redelivery policy on the connection and at the same
time configure AbortSlowAckConsumerStrategy in activemq.xml with
“abortConnection” set to true,  (how) can I control how (which) redelivery
policy is set on the new connection (after the connection has been aborted)? 

From my tests I could see that despite the fact that my
ActiveMQConnectionFactory has the default redelivery policy set in the url
parameters (
failover:(tcp://localhost:61616)?jms.redeliveryPolicy.maximumRedeliveries=0
) and the aborted connection had maximumRedeliveries set to 1 the new
connection got the default redelivery policy (6 redeliveries).

slowConsumerStrategy
abortSlowAckConsumerStrategy ignoreIdleConsumers=false
checkPeriod=6 maxTimeSinceLastAck=60 abortConnection=true/
/slowConsumerStrategy


Any help is appreciated. 
Thanks in the advance.

Regards
Marek Dominiak



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Redelivery-policy-concerns-questions-conumer-based-vs-broker-redelivery-tp4686722.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Broker redelivery with message groups

2014-10-15 Thread Gary Tully
Broker redelivery does a resend. So order is lost. Grouping depends on
ordered delivery to terminate so it won't work as expected.
But best to ask the computer with a test of your use cases and expectations.
Client side consumer mediated redelivery will work as expected
On 7 Oct 2014 10:49, tbenkooe tamas.ben...@1und1.de wrote:

 Hi,

 Is the ordering of the messages in a message groups guaranteed when broker
 redelivery is configured? And vice versa, does broker delivery works if
 messages are grouped?

 I couldn't find anything in the documentation about the interaction of
 these
 features.

 Cheers,
 Tamas




 --
 View this message in context:
 http://activemq.2283324.n4.nabble.com/Broker-redelivery-with-message-groups-tp4686194.html
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Broker redelivery with message groups

2014-10-07 Thread tbenkooe
Hi,

Is the ordering of the messages in a message groups guaranteed when broker
redelivery is configured? And vice versa, does broker delivery works if
messages are grouped?

I couldn't find anything in the documentation about the interaction of these
features.

Cheers,
Tamas




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Broker-redelivery-with-message-groups-tp4686194.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Re:XA transaction not working on Broker redelivery.

2013-10-17 Thread soelvar
Thanks for the info...I am now trying with this example
http://code.google.com/p/camelinaction/source/browse/trunk/chapter9/xa/src/test/resources/spring-context.xml?r=344
but whatever i do i cant get e.g. delayed redelivery to work on the consumer
side. It sounds like you did it...do you mind sharing a bit of your
configuration?

Cheers,
Soelvar



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/XA-transaction-not-working-on-Broker-redelivery-tp4665925p4672804.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Re:XA transaction not working on Broker redelivery.

2013-10-11 Thread Gary Tully
add queue=* attribute. There is a related topic in the archives:
http://mail-archives.apache.org/mod_mbox/activemq-users/201211.mbox/%3c1352825341497-4659265.p...@n4.nabble.com%3E

On 11 October 2013 03:07, soelvar jesper.s.karl...@gmail.com wrote:
 Hi,

 I am trying a simular setup, but am having problems
 redeliveryPlugin/defaultEntry. It is complaining: IllegalArgumentException:
 You must specify the 'destination' property. How did you get around that?

 Cheers,
 Jesper



 --
 View this message in context: 
 http://activemq.2283324.n4.nabble.com/XA-transaction-not-working-on-Broker-redelivery-tp4665925p4672617.html
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com


Re: Re:XA transaction not working on Broker redelivery.

2013-10-10 Thread soelvar
Hi,

I am trying a simular setup, but am having problems
redeliveryPlugin/defaultEntry. It is complaining: IllegalArgumentException:
You must specify the 'destination' property. How did you get around that?

Cheers,
Jesper



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/XA-transaction-not-working-on-Broker-redelivery-tp4665925p4672617.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: XA transaction not working on Broker redelivery.

2013-04-17 Thread Gary Tully
maybe try and build a junit test case and drive the xa transaction
completion via code, see
org.apache.activemq.broker.XARecoveryBrokerTest  for an example and
combine it with org.apache.activemq.broker.BrokerRedeliveryTest from
activemq-unit-tests

Note, the broker redelivery resends the message to the original
destination, so it should get consumed again in a different xa
transaction.


On 15 April 2013 15:11,  guillaume.sur...@orange.com wrote:
 Hello,

 I'm having some troubles using redelivery plugin and XA transactions. I'm 
 using a spring listener-container and JtaTransactionManager in an application 
 server. I'm using ActiveMQ 5.8.0.

 When the listener receives the message, we write it into a database and send 
 a response message during the transaction. In order to test the rollback of 
 the transaction, we throw an exception before the end of transaction.

 When using client redelivery (jms.redeliveryPolicy.maximumRedeliveries=3), 
 everything works as expected: the response message is not sent and the 
 message is not persisted.

 But when using broker redelivery plugin, the behavior is different. After the 
 redelivery delay, the message is sent again but the XA is not working anymore 
 on the messaging side: the response message is sent anyway. So after sending 
 1 message,  I end up with 1 message in my dead letter queue (expected), an 
 empty database (expected), and various duplicate message responses (should be 
 0).

 This is my configuration of the redelivery plugin :
 plugins
redeliveryPlugin fallbackToDeadLetter=true 
 sendToDlqIfMaxRetriesExceeded=true
  redeliveryPolicyMap
redeliveryPolicyMap
  defaultEntry
redeliveryPolicy maximumRedeliveries=6 redeliveryDelay=1 
 /
  /defaultEntry
/redeliveryPolicyMap
  /redeliveryPolicyMap
/redeliveryPlugin
 /plugins

 Has anyone experienced similar problems ? Am I missing something about broker 
 redelivery ?

 Thank you,
 Guillaume

 _

 Ce message et ses pieces jointes peuvent contenir des informations 
 confidentielles ou privilegiees et ne doivent donc
 pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu 
 ce message par erreur, veuillez le signaler
 a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
 electroniques etant susceptibles d'alteration,
 France Telecom - Orange decline toute responsabilite si ce message a ete 
 altere, deforme ou falsifie. Merci.

 This message and its attachments may contain confidential or privileged 
 information that may be protected by law;
 they should not be distributed, used or copied without authorisation.
 If you have received this email in error, please notify the sender and delete 
 this message and its attachments.
 As emails may be altered, France Telecom - Orange is not liable for messages 
 that have been modified, changed or falsified.
 Thank you.




-- 
http://redhat.com
http://blog.garytully.com


XA transaction not working on Broker redelivery.

2013-04-15 Thread guillaume.surrel
Hello,

I'm having some troubles using redelivery plugin and XA transactions. I'm using 
a spring listener-container and JtaTransactionManager in an application server. 
I'm using ActiveMQ 5.8.0.

When the listener receives the message, we write it into a database and send a 
response message during the transaction. In order to test the rollback of the 
transaction, we throw an exception before the end of transaction.

When using client redelivery (jms.redeliveryPolicy.maximumRedeliveries=3), 
everything works as expected: the response message is not sent and the message 
is not persisted.

But when using broker redelivery plugin, the behavior is different. After the 
redelivery delay, the message is sent again but the XA is not working anymore 
on the messaging side: the response message is sent anyway. So after sending 1 
message,  I end up with 1 message in my dead letter queue (expected), an empty 
database (expected), and various duplicate message responses (should be 0).

This is my configuration of the redelivery plugin :
plugins
   redeliveryPlugin fallbackToDeadLetter=true 
sendToDlqIfMaxRetriesExceeded=true
 redeliveryPolicyMap
   redeliveryPolicyMap
 defaultEntry
   redeliveryPolicy maximumRedeliveries=6 redeliveryDelay=1 /
 /defaultEntry
   /redeliveryPolicyMap
 /redeliveryPolicyMap
   /redeliveryPlugin
/plugins

Has anyone experienced similar problems ? Am I missing something about broker 
redelivery ?

Thank you,
Guillaume

_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
France Telecom - Orange decline toute responsabilite si ce message a ete 
altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, France Telecom - Orange is not liable for messages 
that have been modified, changed or falsified.
Thank you.



Re:XA transaction not working on Broker redelivery.

2013-04-15 Thread SuoNayi
Broker redelivery function uses scheduler to redeliver messages.
B/w scheduled messages are out of any transactions so you will see the repsonse 
messages even if rollback is performed. 




At 2013-04-15 22:11:09,guillaume.sur...@orange.com wrote:
Hello,

I'm having some troubles using redelivery plugin and XA transactions. I'm 
using a spring listener-container and JtaTransactionManager in an application 
server. I'm using ActiveMQ 5.8.0.

When the listener receives the message, we write it into a database and send a 
response message during the transaction. In order to test the rollback of the 
transaction, we throw an exception before the end of transaction.

When using client redelivery (jms.redeliveryPolicy.maximumRedeliveries=3), 
everything works as expected: the response message is not sent and the message 
is not persisted.

But when using broker redelivery plugin, the behavior is different. After the 
redelivery delay, the message is sent again but the XA is not working anymore 
on the messaging side: the response message is sent anyway. So after sending 1 
message,  I end up with 1 message in my dead letter queue (expected), an empty 
database (expected), and various duplicate message responses (should be 0).

This is my configuration of the redelivery plugin :
plugins
   redeliveryPlugin fallbackToDeadLetter=true 
 sendToDlqIfMaxRetriesExceeded=true
 redeliveryPolicyMap
   redeliveryPolicyMap
 defaultEntry
   redeliveryPolicy maximumRedeliveries=6 redeliveryDelay=1 /
 /defaultEntry
   /redeliveryPolicyMap
 /redeliveryPolicyMap
   /redeliveryPlugin
/plugins

Has anyone experienced similar problems ? Am I missing something about broker 
redelivery ?

Thank you,
Guillaume

_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
France Telecom - Orange decline toute responsabilite si ce message a ete 
altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, France Telecom - Orange is not liable for messages 
that have been modified, changed or falsified.
Thank you.



RE: Re:XA transaction not working on Broker redelivery.

2013-04-15 Thread guillaume.surrel
Ok, so I'm experiencing an expected behavior.
Is there a way to achieve what I'm expecting: broker redelivery with 
transaction support similar to client redelivery ?

Thanks,
Guillaume


-Message d'origine-
De : SuoNayi [mailto:suonayi2...@163.com] 
Envoyé : lundi 15 avril 2013 16:44
À : users@activemq.apache.org
Objet : Re:XA transaction not working on Broker redelivery.

Broker redelivery function uses scheduler to redeliver messages.
B/w scheduled messages are out of any transactions so you will see the repsonse 
messages even if rollback is performed. 




At 2013-04-15 22:11:09,guillaume.sur...@orange.com wrote:
Hello,

I'm having some troubles using redelivery plugin and XA transactions. I'm 
using a spring listener-container and JtaTransactionManager in an application 
server. I'm using ActiveMQ 5.8.0.

When the listener receives the message, we write it into a database and send a 
response message during the transaction. In order to test the rollback of the 
transaction, we throw an exception before the end of transaction.

When using client redelivery (jms.redeliveryPolicy.maximumRedeliveries=3), 
everything works as expected: the response message is not sent and the message 
is not persisted.

But when using broker redelivery plugin, the behavior is different. After the 
redelivery delay, the message is sent again but the XA is not working anymore 
on the messaging side: the response message is sent anyway. So after sending 1 
message,  I end up with 1 message in my dead letter queue (expected), an empty 
database (expected), and various duplicate message responses (should be 0).

This is my configuration of the redelivery plugin :
plugins
   redeliveryPlugin fallbackToDeadLetter=true 
 sendToDlqIfMaxRetriesExceeded=true
 redeliveryPolicyMap
   redeliveryPolicyMap
 defaultEntry
   redeliveryPolicy maximumRedeliveries=6 redeliveryDelay=1 /
 /defaultEntry
   /redeliveryPolicyMap
 /redeliveryPolicyMap
   /redeliveryPlugin
/plugins

Has anyone experienced similar problems ? Am I missing something about broker 
redelivery ?

Thank you,
Guillaume

___
__

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc pas etre diffuses, 
exploites ou copies sans autorisation. Si vous avez recu ce message par 
erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les 
pieces jointes. Les messages electroniques etant susceptibles d'alteration, 
France Telecom - Orange decline toute responsabilite si ce message a ete 
altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law; they should not be distributed, used 
or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, France Telecom - Orange is not liable for messages 
that have been modified, changed or falsified.
Thank you.


_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,
France Telecom - Orange decline toute responsabilite si ce message a ete 
altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged 
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete 
this message and its attachments.
As emails may be altered, France Telecom - Orange is not liable for messages 
that have been modified, changed or falsified.
Thank you.