English 中文(简体)
Why are my transactional ActiveMQ messages being dropped instead of moving to the DLQ?
原标题:

I create my consumer (in C# using the NMS library) as so:

        ConnectionFactory factory = new ConnectionFactory(_mqServer);
        _con = factory.CreateConnection();
        _con.Start();
        _session = _con.CreateSession(AcknowledgementMode.Transactional);
        _queue = _session.GetQueue(_mqQueue);
        _consumer = _session.CreateConsumer(_queue, "someproperty =  someValue ");

When I receive a message and don t call Commit on the session, it goes back into the original queue. It then attempts redelivery 5 more times before being discarded. Why is the message being discarded instead of being sent to a DLQ?!

问题回答

I know this was a long time ago so it probably won t help you, but one possible reason for this is that you re not sending persistent messages. If your messages aren t persistent, ActiveMQ will discard them instead of sending them to the DLQ.

If it really is being discarded, it might actually be a bug. I have not tried to reproduce but during debug of an aplpication, i actually had a similar issue (forgot to commit transaction) and the messages did go to the DLQ. after retrying a couple of times.. so if you are sure they just get discarded, it might be a bug.





相关问题
WCF Transaction Flow Question

I would like to configure WCF service operations to accept a transaction if my client sends one, but not to create one if none is sent. I think this would be similar to the Supported transaction ...

question about pl/sql exception

the following text is an excerpt of oracle documentation Oracle® Database PL/SQL Language Reference 11g Release 1 (11.1) : Unhandled exceptions can also affect subprograms. If you exit a ...

SQL Server - transactions roll back on error?

We have client app that is running some SQL on a SQL Server 2005 such as the following: BEGIN TRAN; INSERT INTO myTable (myColumns ...) VALUES (myValues ...); INSERT INTO myTable (myColumns ...) ...

Cannot rollback transaction with Entity Framework

I have to do queries on uncommitted changes and I tried to use transactions, but I found that it do not work if there are exceptions. I made a simple example to reproduce the problem. I have a ...

mySQL - Prevent double booking

I am trying to work out the best way to stop double booking in my application. I have a table of unique id s each can be sold only once. My current idea is to use a transaction to check if the ...

热门标签