You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by slew77 <st...@yahoo.co.uk> on 2016/01/19 16:44:21 UTC

Reject an incoming message from Camel

Hi,

I've configured a camel route intercepting an inbound message.

If something goes wrong when processing the camel route, I'd like to be able
to reject the incoming message in a way that the client knows that the
message hasn't been accepted.

If my route doesn't forward the message back to the broker, the message is
dropped, but this is silent - the client thinks the message was accepted.

If I raise an exception from the route, I see this in the log, but with the
same outcome, the client still thinks the message has been accepted.

Is there a way to reject an inbound message?

Thanks,
Steve.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Reject-an-incoming-message-from-Camel-tp4706168.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Reject an incoming message from Camel

Posted by artnaseef <ar...@artnaseef.com>.
Note, by the way, that asyncSend=false only affects the send from the
producer to the broker - not from the broker to the consumer.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Reject-an-incoming-message-from-Camel-broker-component-tp4706168p4706422.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Reject an incoming message from Camel

Posted by artnaseef <ar...@artnaseef.com>.
There is no way to notify a message producer if consumption of the message
fails through JMS semantics.  That defeats the major aspect of JMS -
asynchronous processing and loose coupling of producers and consumers.

In order to inform the producer of success or failure, one of the following
would do the job:

* use a request/reply pattern (every message processed results in a message
result sent back to the original client)
* use a separate notification method (e.g. consumer posts errors to a store,
such as hazelcast)
* convert over to a synchronous messaging solution





--
View this message in context: http://activemq.2283324.n4.nabble.com/Reject-an-incoming-message-from-Camel-broker-component-tp4706168p4706421.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Reject an incoming message from Camel

Posted by Claus Ibsen <cl...@gmail.com>.
I wonder if you need to use asyncSend=false (to force sync) on the
client, and then with the camel broker component you can route and
possible reject the incoming message. Which maybe can affect that the
client get a NACK ?

http://activemq.apache.org/broker-camel-component.html
http://activemq.apache.org/async-sends.html

On Wed, Jan 20, 2016 at 12:00 PM, slew77 <st...@yahoo.co.uk> wrote:
> Thanks. I'd prefer the clients to not have to do anything special.
>
> Is there any way to intercept an inbound message and affect the
> acknowledgement back to the producer so they know the send failed
> immediately?
>
> This doesn't necessarily have to be camel if there is another way to achieve
> the same.
>
> Thanks,
> Steve.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Reject-an-incoming-message-from-Camel-broker-component-tp4706168p4706198.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Reject an incoming message from Camel

Posted by slew77 <st...@yahoo.co.uk>.
Thanks. I'd prefer the clients to not have to do anything special.

Is there any way to intercept an inbound message and affect the
acknowledgement back to the producer so they know the send failed
immediately?

This doesn't necessarily have to be camel if there is another way to achieve
the same.

Thanks,
Steve.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Reject-an-incoming-message-from-Camel-broker-component-tp4706168p4706198.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Reject an incoming message from Camel

Posted by Tim Bain <tb...@alumni.duke.edu>.
Can you forward the message to a "rejected message" topic, so consumers
could subscribe and get messages that are rejected?  If you don't want to
send the original message, you should be able to use a custom transformer
to create a different message of your choosing.

Tim
On Jan 19, 2016 10:36 AM, "slew77" <st...@yahoo.co.uk> wrote:

> Hi,
>
> I've configured a camel route intercepting an inbound message.
>
> If something goes wrong when processing the camel route, I'd like to be
> able
> to reject the incoming message in a way that the client knows that the
> message hasn't been accepted.
>
> If my route doesn't forward the message back to the broker, the message is
> dropped, but this is silent - the client thinks the message was accepted.
>
> If I raise an exception from the route, I see this in the log, but with the
> same outcome, the client still thinks the message has been accepted.
>
> Is there a way to reject an inbound message?
>
> Thanks,
> Steve.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Reject-an-incoming-message-from-Camel-tp4706168.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>