Dmitriy Kargapolov wrote:
Hi,
I'm playing with C++ Qpid broker M4 and .NET client (Win32).
Test scenario looks this way:
1) open connection
2) create a session (timeout = 0 sec)
3) declare a queue (durable, exclusive)
4) subscribe to the queue
5) transfer test message to the exchange
6) wait until message arrives from the queue
7) accept the message
8) close session
9) close connection
When I run this test, it works just fine. But the message left in the queue
after test completed! Second pass returns 2 messages - new and old one, 3rd
pass - 3 messages etc.
I was able to "fix" this in various ways:
1) If I add short delay (100ms) between steps 7) and 8), accepted message
successfully deleted from the queue.
Obviously this way is ugly.
I'm not very familiar with the .Net client but what I suspect you want
to do is sync with the server on or after step 7 to ensure that the
server has processed your accept before you exit.
I believe session.sync() should do that, or alternatively setting
session.setAutoSync(true). As mentioned though, I'm no expert on the
.Net client but hopefully Arnaud or others will correct me if thats wrong.
2) If session is created with some expiration timeout, 1st try works fine.
But second try got locked due to exclusive subscription of the 1st session
which still exists in the broker (until timeout expired). Definitely this is
not what I want.
I would not specify any timeout. The session resume feature is not fully
implemented I believe.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]