activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vince Cole <>
Subject Can ActiveMQ reject a message on send?
Date Wed, 29 Mar 2017 11:47:40 GMT
A similar question was asked about a year ago.

However, I'm not sure if it was absolutely answered with a definitive yes or
Can anyone clear this up, one way or another, please?

* This behaviour absolutely must be SYNCHRONOUS.
* It has absolutely nothing to do with anything happening on the consumer
* Interestingly, though, it looks exactly like a PRODUCER's version of the
'Message level Authorization' plugin (which is only available for consumers)
detailed at the bottom of 

Is it possible, or not, to implement the following scenario:

1. A JMS producer (using AMQP 1.0) sends a message, syncronously, to
ActiveMQ, for it to be enqueued.
2. ActiveMQ checks if the message is allowed (according to business-defined
rules, concerning the message content) to be sent to the queue which the
producer requested it be enqueued to.
3a. If the message is allowed in that queue, ActiveMQ enqueues in the usual
manner, and the JMS producer's (send) method returns normally.
3b. If the message is NOT allowed in that queue, ActiveMQ rejects the
message, and the JMS producer's (send) method throws an exception:
***This needs to work in the same way as a JMS exception being thrown, from
within the send method, if a producer tries to send a message a non-existent
queue which they aren't authorized to create.***

This is to allow the producer to know, AT THE TIME OF TRYING TO SEND,
whether or not their message was actually enqueued in the broker or not. 

The producer application must NOT discard its copy of the message until the
copy which was sent to the broker has been enqueued.

If an exception is thrown from the producer's send method, the message must
NOT be considered as 'sent'. The application which calls the producer can
then make the appropriate decision WRT what to do with the (as yet, still
'not sent') message.



View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message