[rabbitmq-discuss] building chat
Ram Muthiah
ram.muthiah at yahoo.com
Thu Aug 27 18:33:52 BST 2009
Hi Ben,
Thank you for the reply. I am working on this application to achieve the business goal. It’s the real thing!
The idea is to have chat inside my iPhone application. iPhone app interacts with my server code to get the list of friends and their presence. iPhone displays all friends in the chat window, user can pick a friend and chat with him/her.
Whenever the chat message is routed thru RabbitMQ server and if there is no ack from the friend, program can check the application server for the presence and let the user knows if his friend is offline.
I think I can avoid using XMPP gateway on top of RabbitMQ.
I don’t quite understand about default exchange you mentioned. I didn’t even know there is a default exchange. Can I use this default exchange for both one-to-one chat and multi-user chat?
I am using different queues for both of these chat types. There will be only one queue for mult-user chat, each user will read from it and write into it. For one-to-one chat, each user will have his/her own queue. If I want to send message to my friend, I will send message to his queue, then he read from there. When he wants to send message to me, he will put his message in my queue, I will take it from there.
I assumed that I need to have separate exchanges for different chat types. It appears that I can use the same exchange. Is there any user/message limit on each exchange?
Thanks again for taking time to answer my queries.
Ram
________________________________
From: Ben Hood <0x6e6562 at gmail.com>
To: Ram Muthiah <ram.muthiah at yahoo.com>
Cc: rabbitmq <rabbitmq-discuss at lists.rabbitmq.com>
Sent: Thursday, August 27, 2009 5:22:05 AM
Subject: Re: [rabbitmq-discuss] building chat
Ram,
On Thu, Aug 27, 2009 at 3:05 AM, Ram Muthiah<ram.muthiah at yahoo.com> wrote:
> Based on Ben and Alexis's discussion, I came up with the following logic.
> Let me know if you guys see any flaw in it. I use two exchanges; one for
> one-to-one chat and another for multi-user chat. Clients will use Java. I
> create one queue per user. Effectively, there will be two queues per chat.
Fundamentally I don't see that much wrong with it. However I am
wondering what your intention is - do you need an application to
achieve a business goal or are you just getting your feet wet with
AMQP?
Here are some study notes:
- If you want to route directly to a named queue, you can publish to
the default exchange (In Java this an empty string as a name) with the
name of the queue as a routing key. No need to create an extra
exchange for this;
- How is your application going to know about the non-acknowledgement
of messages on the outbound side (this is where you expect the client
to display the "user offline")? Seems to me that you need presence to
do this (i.e. the 1st P in XMPP).
Cheers,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090827/8ea4f786/attachment.htm
More information about the rabbitmq-discuss
mailing list