Erlang Mailing Lists

Author Message

<  RabbitMQ mailing list  ~  Starting RabbitMQ-Server and message storage

Guest
Posted: Tue Nov 06, 2007 9:51 pm Reply with quote
Guest
When I start the server on the command line with "rabbitmq-server",
will the messages be kept in memory or disk? Is there a way to
specify type of message storage at the command line?

On the dos prompt, if I do ctrl+c, does it mean all the messages will
be lost when the server restarted at some point?

Thanks,
joe

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post recived from mailinglist
tonyg
Posted: Wed Nov 07, 2007 12:58 pm Reply with quote
User Joined: 07 Nov 2006 Posts: 199
Hi Joe,

joe lee wrote:
> When I start the server on the command line with "rabbitmq-server",
> will the messages be kept in memory or disk? Is there a way to
> specify type of message storage at the command line?

The server makes available both in-memory and on-disk storage to
clients. Which is used depends on both (a) the "durability" setting of
the queue concerned, and (b) the "delivery mode" property of Basic messages.

Messages will be stored in memory if EITHER the queue is declared with
"durable" set false OR the message is published with "delivery mode"
missing or set to non-persistent (= 1).

Messages will be stored on disk if BOTH the queue is declared with
"durable" set true AND the message is published with "delivery mode"
present and set to persistent (= 2).

Here's an example of publishing a persistent message to a durable queue,
using RabbitMQ's Java API:

// The "true" below makes the queue durable.

myChannel.queueDeclare(ticket, "queuename", true);

// The MessageProperties.PERSISTENT_TEXT_PLAIN is a useful
// preallocated BasicProperties instance that has a text/plain
// content-type and a delivery mode of 2 (== persistent).

myChannel.basicPublish(ticket, "", "queuename",
MessageProperties.PERSISTENT_TEXT_PLAIN,
"hello, world".getBytes("UTF-8"));


> On the dos prompt, if I do ctrl+c, does it mean all the messages will
> be lost when the server restarted at some point?

Only those in memory. Also, all non-durable queues will be lost. Durable
queues, however, should survive server restarts, as should persistent
messages held by durable queues.

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 recived 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