You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Riyafa Abdul Hameed <ri...@apache.org> on 2019/05/17 09:48:50 UTC

Nack a message in Artemis core API

Hi,

Is it possible to Nack or reject a message in the Artemis core API? Or does
the message have a time frame after which it will be delivered to the next
consumer if it is not acked?

If a message is not to my liking I would like to reject it. How can I do
that?

Thanks,
Riyafa

Re: Nack a message in Artemis core API

Posted by Riyafa Abdul Hameed <ri...@apache.org>.
Thank you. Let me try that.

On Thu, 23 May 2019 at 01:28, Justin Bertram <jb...@apache.org> wrote:

> If you want to reject a message then when you create your consumer make
> sure you set autoCommitAcks to false and then if you want to reject a
> message invoke
> org.apache.activemq.artemis.api.core.client.ClientSession#rollback(). See
> this test-case [1] for an example.
>
>
> Justin
>
> [1]
>
> https://github.com/apache/activemq-artemis/blob/c61f2d5324d11461efbb159d8e73847789cda8cf/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java#L436
>
> On Fri, May 17, 2019 at 4:49 AM Riyafa Abdul Hameed <ri...@apache.org>
> wrote:
>
> > Hi,
> >
> > Is it possible to Nack or reject a message in the Artemis core API? Or
> does
> > the message have a time frame after which it will be delivered to the
> next
> > consumer if it is not acked?
> >
> > If a message is not to my liking I would like to reject it. How can I do
> > that?
> >
> > Thanks,
> > Riyafa
> >
>

Re: Nack a message in Artemis core API

Posted by Justin Bertram <jb...@apache.org>.
If you want to reject a message then when you create your consumer make
sure you set autoCommitAcks to false and then if you want to reject a
message invoke
org.apache.activemq.artemis.api.core.client.ClientSession#rollback(). See
this test-case [1] for an example.


Justin

[1]
https://github.com/apache/activemq-artemis/blob/c61f2d5324d11461efbb159d8e73847789cda8cf/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java#L436

On Fri, May 17, 2019 at 4:49 AM Riyafa Abdul Hameed <ri...@apache.org>
wrote:

> Hi,
>
> Is it possible to Nack or reject a message in the Artemis core API? Or does
> the message have a time frame after which it will be delivered to the next
> consumer if it is not acked?
>
> If a message is not to my liking I would like to reject it. How can I do
> that?
>
> Thanks,
> Riyafa
>