[rabbitmq-discuss] Questions on RabbitMQ
Ralf Kistner
ralf.kistner at gmail.com
Sat Sep 25 12:07:11 BST 2010
I'm new to RabbitMQ (and AMQP), but I'm considering its use in an application.
I currently have a web application (Rails), and a mobile client (J2ME)
communicating with the web server via HTTP. The mobile client has to
operate in offline mode, so it keeps a persistent queue of messages to
be sent to the server. It periodically tries to send these messages to
the server, and keeps them if there is a network or server error.
I'd like to use RabbitMQ to improve the reliability, and to move to
socket connections instead of HTTP. I'd like to do the following:
1. Have the mobile client send messages to RabbitMQ using the STOMP plugin.
2. Have a Ruby script that consumes the messages on the server.
3. Keep a backup of all the messages sent to the server.
I have some questions about the above:
1 a. The client needs to be authenticated. I already have a simple
authentication system in the web application. Is it possible to use
this for authentication, or would I need to copy the authentication
data to RabbitMQ?
1 b. Is there a simple way to use SSL/TLS for the STOMP connection?
2 a. Are there any recommended practices for running a (Ruby) process
to consume messages in an infinite loop?
2 b. The Ruby script would occasionally be unable to process a
message. This could be because of a temporary lock on the database, an
invalid message from the mobile client, or a bug on the server. The
ideal would be for these messages to be retried a few times, then
moved to a different queue if it still fails. The messages in the
queue could then be inspected manually, and moved back to the original
queue when the bug was fixed.
How would this be accomplished? Does RabbitMQ have something like a
dead letter queue? Or would I have to move the message to a different
queue myself (in the Ruby script), in case of an error?
Note that I can't return any messages to the sender, I want to keep it
on the server in a different queue.
3. What is the best way to create a backup of all the message sent to
the server? Does RabbitMQ automatically do this, or should I write an
additional consumer to create a backup?
Regards,
Ralf Kistner
More information about the rabbitmq-discuss
mailing list