*Rationale : *

According to AMQP spec 0_9_1 : Once purged, We need to remove all messages
which are not awaiting acknowledgement from the given queue. [1]

*Requirements in terms of MB 3.0.0 architecture : *

Once a queue purge is requested from UI console (queue->browse page), all
messages addressed to that queue :

   1. should be removed from the store (JDBC / Cassandra)
   2. that are still queued for delivery in memory should be cleared

Any message counters for the queue in store should be reset to 0.

*Messages published to that queue immediately after a purge should still be
received by the subscriber later.

*Development Approach :*

Refer sequence diagram [2] for implementation / flow. This is subject to
change in line with [3] and [4] concerns.

*Test Scenarios : (Not yet automated)*

   1. Publish N messages -> purge queue -> subscribe and verify that no
   messages are received.
   2. Publish N messages -> subscribe -> purge queue before receiving all
   messages -> verify that no messages are delivered / verify that only the
   immediately enqueued messages are delivered. (This test will need to access
   in-memory message collection sizes)
   3. Publish N messages -> purge queue -> subscribe -> publish N messages
   -> verify that the second message batch is received.
   4. Perform above tests with parallel publishers/subscribers

*Current Concerns : *

   1. Message content can be lost for some messages when purging in the
   middle of a pub/sub situation [3].
   2. There is a performance hit in reading all message IDs from the
   metadata table prior to clearing. But given our current model, this is
   necessary to delete the message content relevant to a specific queue [4].


Appreciate your feedback/suggestions on anything I have missed out or any
improvements.

[1] : http://www.rabbitmq.com/amqp-0-9-1-quickref.html
[2] :
https://drive.google.com/file/d/0B1soNraLsHdmdUdWSUVzdml5Mzg/view?usp=sharing
<https://drive.google.com/a/wso2.com/file/d/0B1XfuoFd-MhENk02ZDNvcXpPUHM/view?usp=sharing>
[3] : [DEV] Concern when purging during active subscriptions - MB 3.0.0
[4] : [DEV] Way to optimize database calls during queue purge - MB 3.0.0

-- 
Cheers,
Hasitha Amal De Silva
 Software Engineer
Mobile : 0772037426
Blog    : http://devnutshell.tumblr.com/
WSO2 Inc.: http://wso2.com ( lean.enterprise.middleware. )
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to