Erlang/OTP Forums

Author Message

<  RabbitMQ mailing list  ~  TX for guarantees of completion (was persistence)

tonyg
Posted: Fri May 30, 2008 9:15 am Reply with quote
User Joined: 07 Nov 2006 Posts: 199
Lars Bachmann wrote:
> Mathias,
>
> I made some more tests [...]

Just to reiterate what Matthias said: I think that using TX mode will
get you the behaviour you're after.

If you like, you could try the following:

1. as soon as you have opened a channel, call txSelect() on it
2. every 50 (or 10, or 100, or 500) publishes, call txCommit()
3. just before you call close(), call txCommit()

If you do something like this, you are effectively using the txCommit
(and, importantly, the reply you receive to it from the server) as a
synchronisation point.

The reply to txCommit counts as confirmation from the server that all
the submitted messages prior to the commit have been processed.

The final call to txCommit immediately before close is the part that
forces all the outstanding work to be complete before the socket closes.

You can vary the number in step two to trade off latency against throughput.

Do let us know how this works out for you, if you try it!

Regards,
Tony
--
[][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211
[][] LShift Ltd | Tel: +44 (0)20 7729 7060
[] [] http://www.lshift.net/ | Email: tonyg@lshift.net

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
View user's profile Send private message MSN Messenger

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum