Jan,

I'm not sure which broker you're using.  If you're using the Java Broker,
note that you can configure it to send messages to the dead letter queue
after N attempts with this sort of thing in your virtualhosts.xml:

    ...
    <queues>
        <maximumDeliveryCount>1</maximumDeliveryCount>
        ...

The delivery count is incremented each time the message is rejected by the
client, eg when it explicitly calls session.rollback() after your
application code decides that its format is wrong.

If that looks like it might be useful then I send a more complete example,
i.e. including the specification of the alternate exchange.

Phil


On 7 November 2012 12:45, Gordon Sim <[email protected]> wrote:

> On 11/07/2012 12:11 PM, Jan Bares wrote:
>
>> we are planning to reject messages that do not satisfy message contract
>> (e.g. message is of wrong format). The reject and DLQ seems to be the right
>> solution for this problem.
>>
>
> At present the only thing I can suggest is that you have the client itself
> send the 'rejected' message to the DLQ (or exchange or whatever). You can
> do this before acknowledging it to avoid losing it on failure if that is
> important.
>
> Longer term perhaps the JMS client could recognise a certain category of
> exception thrown by a MessageListener and interpret that as a desire to
> reject the message in question. Any thoughts on that from the JMS devs?
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> [email protected].**org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to