| Author |
Message |
|
| Guest |
Posted: Thu Sep 10, 2009 7:53 pm |
|
|
|
Guest
|
| I have the following situation. I am thinking of using RabbitMQ for chat inside my iPhone application. iPhone application is connected to the server thru socket server. The socket server passes the information from iPhone to the server and vice versa. I am not sure how could I make this communication path works |
|
|
| Back to top |
|
| 0x6e6562 |
Posted: Fri Sep 11, 2009 6:39 am |
|
|
|
User
Joined: 12 Jul 2007
Posts: 250
|
Alex,
On 10 Sep 2009, at 20:52, Alex Gentle <alexgentle@sify.com> wrote:
> I have the following situation. I am thinking of using RabbitMQ for
> chat inside my iPhone application. iPhone application is connected
> to the server thru socket server. The socket server passes the
> information from iPhone to the server and vice versa. I am not sure
> how could I make this communication path works – iPhone -> Socket Se
> rver -> RabbitMQ server. I understand that I can connect the client
> directly to RabbitMQ server using client library you provided. I am
> not sure how could I pass the message thru socket server. Socket s
> erver basically accepts the incoming message from iPhone and route t
> he message to appropriate server based on header information in the
> incoming message. It does the same thing when a server wants to comm
> unicate to the client thru socket server. Socket server accepts only
> binary data. Is it a overkill to use RabbitMQ for this purpose? If
> I use XMPP like ejabbberd, I would still have the same issue of rou
> ting the message thru socket server. Any help is much appreciated.
> Thanks!
I don't understand your intention. What problem are you actually
trying to solve? Are you trying to write an iPhone app that can send
and receive messages to and from RabbitMQ? I don't understand what
this socket server is doing apart from relaying data to either Rabbit
or ejabberd.
Ben
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Mon Sep 14, 2009 7:15 pm |
|
|
|
Guest
|
| Ben, Socket server is just relaying data back and forth. It's essential to use socket server, because of the way entire application is set up. My iPhone app has chat inside in addition to couple of other photo sharing features. The idea is to use RabbitMq for iPhone chat app |
|
|
| Back to top |
|
| 0x6e6562 |
Posted: Mon Sep 14, 2009 11:12 pm |
|
|
|
User
Joined: 12 Jul 2007
Posts: 250
|
Alex,
On Mon, Sep 14, 2009 at 8:15 PM, Alex Gentle <alexgentle@sify.com> wrote:
> Ben, Socket server is just relaying data back and forth. It's essential to
> use socket server, because of the way entire application is set up. My
> iPhone app has chat inside in addition to couple of other photo sharing
> features. The idea is to use RabbitMq for iPhone chat app |
|
|
| Back to top |
|
| Guest |
Posted: Tue Sep 15, 2009 1:10 am |
|
|
|
Guest
|
>Alex, you haven't explained why your app can only send a specific
>binary stream to a socket - for intents and purposes AMQP is no more
>than a *stream* of binary data.
I am not sure. It's not a specific binary stream, it can be any binary data. But, this binary data can't be interpreted by RabbitMQ unless I put another middle layer to translate this into call to RabbitMQ.
>I don't know how the network event notification works in iPhone OS 3.x
>(i.e. I don't know whether you get it to pre-empt the phone's kernel).
Actually it's not related to iPhone. I was mentioning about polling mechanism in RabbitMQ. Meaning that, RabbitMQ doesn't inform the user when he gets the message. User has to check every few seconds to see if there is anything in his queue. So, iPhone app (OR any application for that matter) needs to constantly check RabbitMQ to see if there is any message. That's going to cost lot of bandwidth when I port the app to mobile devices.
Thank you for all the answers.
On Mon, Sep 14, 2009 at 4:12 PM, Ben Hood <0x6e6562@gmail.com (0x6e6562@gmail.com)> wrote:
Quote: Alex,
On Mon, Sep 14, 2009 at 8:15 PM, Alex Gentle <alexgentle@sify.com (alexgentle@sify.com)> wrote:
> Ben, Socket server is just relaying data back and forth. It's essential to
> use socket server, because of the way entire application is set up. My
> iPhone app has chat inside in addition to couple of other photo sharing
> features. The idea is to use RabbitMq for iPhone chat app |
|
|
| Back to top |
|
| Guest |
Posted: Tue Sep 15, 2009 3:12 am |
|
|
|
Guest
|
On Sep 14, 2009, at 8:09 PM, Alex Gentle wrote:
> >Alex, you haven't explained why your app can only send a specific
> >binary stream to a socket - for intents and purposes AMQP is no more
> >than a *stream* of binary data.
>
> I am not sure. It's not a specific binary stream, it can be any
> binary data. But, this binary data can't be interpreted by RabbitMQ
> unless I put another middle layer to translate this into call to
> RabbitMQ.
>
> >I don't know how the network event notification works in iPhone OS
> 3.x
> >(i.e. I don't know whether you get it to pre-empt the phone's
> kernel).
>
> Actually it's not related to iPhone. I was mentioning about polling
> mechanism in RabbitMQ. Meaning that, RabbitMQ doesn't inform the
> user when he gets the message. User has to check every few seconds
> to see if there is anything in his queue. So, iPhone app (OR any
> application for that matter) needs to constantly check RabbitMQ to
> see if there is any message. That's going to cost lot of bandwidth
> when I port the app to mobile devices.
>
> Thank you for all the answers.
You don't need AMQP on your client side at all based upon your
descriptions. You already have a methodology for contacting a server
(the socket connection described). The only role for AMQP would be on
the server side.
I think you might be trying to squeeze AMQP (and rabbit) into a place
where it doesn't fit.
Why don't you try describing your entire messaging architecture for
us. Perhaps we can suggest improvements.
cr
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Sep 16, 2009 12:57 am |
|
|
|
Guest
|
>You don't need AMQP on your client side at all based upon your
>descriptions. You already have a methodology for contacting a server
>(the socket connection described). The only role for AMQP would be on
>the server side.
I am not sure how you got that impression. I am not using AMQP on the client side. I never mentioned it like that. iPhone is the client. AMQP (RabbitMQ) is installed in our server.
>I think you might be trying to squeeze AMQP (and rabbit) into a place
>where it doesn't fit.
>Why don't you try describing your entire messaging architecture for
>us. Perhaps we can suggest improvements.
Here it is...
iPhone app -> socket server -> RabbitMQ server
iPhone app has some social networking features in addition to the chat component. Think of it like mini-facebook inside iPhone. When a user types a message inside chat window of iPhone app, the message travels to Socket server which directs the message depending on what is on the message header. If the message header says "this message is for RabbitMQ", socket server will route to RabbitMQ. When a message comes from RabbitMQ to socket server, it should have message header that says "Route this to xxxxxx user". Then, socket server will route the message to appropriate user(s).
It all looks good, but it doesn't work. Because I don't know how to make a call to RabbitMQ using the message from socket server and how to pass the message from RabbitMQ to socket server in binary format.
Thanks.
On Mon, Sep 14, 2009 at 8:11 PM, Chuck Remes <cremes.devlist@mac.com (cremes.devlist@mac.com)> wrote:
Quote:
On Sep 14, 2009, at 8:09 PM, Alex Gentle wrote:
> >Alex, you haven't explained why your app can only send a specific
> >binary stream to a socket - for intents and purposes AMQP is no more
> >than a *stream* of binary data.
>
> I am not sure. It's not a specific binary stream, it can be any
> binary data. But, this binary data can't be interpreted by RabbitMQ
> unless I put another middle layer to translate this into call to
> RabbitMQ.
>
> >I don't know how the network event notification works in iPhone OS
> 3.x
> >(i.e. I don't know whether you get it to pre-empt the phone's
> kernel).
>
> Actually it's not related to iPhone. I was mentioning about polling
> mechanism in RabbitMQ. Meaning that, RabbitMQ doesn't inform the
> user when he gets the message. User has to check every few seconds
> to see if there is anything in his queue. So, iPhone app (OR any
> application for that matter) needs to constantly check RabbitMQ to
> see if there is any message. That's going to cost lot of bandwidth
> when I port the app to mobile devices.
>
> Thank you for all the answers.
You don't need AMQP on your client side at all based upon your
descriptions. You already have a methodology for contacting a server
(the socket connection described). The only role for AMQP would be on
the server side.
I think you might be trying to squeeze AMQP (and rabbit) into a place
where it doesn't fit.
Why don't you try describing your entire messaging architecture for
us. Perhaps we can suggest improvements.
cr
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com (rabbitmq-discuss@lists.rabbitmq.com)
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Sep 16, 2009 2:28 am |
|
|
|
Guest
|
On Sep 15, 2009, at 7:19 PM, Alex Gentle wrote:
> iPhone app -> socket server -> RabbitMQ server
Great, this is very helpful.
> iPhone app has some social networking features in addition to the
> chat component. Think of it like mini-facebook inside iPhone. When a
> user types a message inside chat window of iPhone app, the message
> travels to Socket server which directs the message depending on what
> is on the message header. If the message header says "this message
> is for RabbitMQ", socket server will route to RabbitMQ. When a
> message comes from RabbitMQ to socket server, it should have message
> header that says "Route this to xxxxxx user". Then, socket server
> will route the message to appropriate user(s).
>
> It all looks good, but it doesn't work. Because I don't know how to
> make a call to RabbitMQ using the message from socket server and how
> to pass the message from RabbitMQ to socket server in binary format.
Ah, this is good.
You need to declare an exchange (of type direct, fanout or topic)
which acts as the mailbox for sending the message. Once you have
parsed the message from socket server and determined it should go to
rabbit, you publish the message to it. Here's some ruby code
(commented).
def publish_message_to_rabbit(message)
# declare the exchange
exchange = MQ.direct 'mailbox'
# send the message
exchange.publish(message, :key => 'some.routing.key')
end
Next, you need to have a client somewhere that is listening for
messages. You need to allocate a queue to receive the message and
subscribe to the routing key. Again, some ruby code.
def listen_for_rabbit_messages
# redeclare the exchange; idempotent operation
exchange = MQ.direct 'mailbox'
# declare a queue to receive the messages
queue = MQ.queue 'mailslot'
# bind the queue to the exchange and match incoming messages against
# the specified routing key
queue.bind(exchange, :key => 'some.routing.key').subscribe do |
message|
# this block is called each time a message is received
# do your message processing here
end
end
Does this help? I highly recommend you take a look through the sample
code and come back with specific questions.
cr
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| 0x6e6562 |
Posted: Wed Sep 16, 2009 8:04 am |
|
|
|
User
Joined: 12 Jul 2007
Posts: 250
|
Alex,
On Wed, Sep 16, 2009 at 1:19 AM, Alex Gentle <alexgentle@sify.com> wrote:
> It all looks good, but it doesn't work. Because I don't know how to make a
> call to RabbitMQ using the message from socket server and how to pass the
> message from RabbitMQ to socket server in binary format.
Now I see what your issue is - effectively it has nothing to do with
the iPhone. It's just a case of how to program your socket server
handler to talk to Rabbit in a sensible way. The way you formulated
your original question indicated that you were actually thinking of
running a Rabbit client on the iPhone.
Ben
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 12:40 am |
|
|
|
Guest
|
| [code:1:f2f1498f12]>You need to declare an exchange (of type direct, fanout or topic) |
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 12:28 pm |
|
|
|
Guest
|
On Sep 17, 2009, at 7:40 PM, Alex Gentle wrote:
Quote: >Once you have parsed the message from socket server and determined it >should go to rabbit, you publish the message to it. [/code] |
|
|
| Back to top |
|
| Guest |
Posted: Tue Sep 22, 2009 2:29 am |
|
|
|
Guest
|
Hi Chuck,
>I think we are getting ahead of ourselves. Your original post indicated that your code did not work but now you are worried about performance. Let's get your code working first and then you can worry >about optimizing it later.
>Can you successfully publish your messages yet? If so, can you pop them off of the queue to read them?
Yes. The code is working. I can publish and retrieve the messages from the queue. It works well.
>Polling is usually a bad idea particularly since it requires a lot of unnecessary messaging. Most AMQP libraries I have seen allow for two ways to fetch messages. One way is to "get" them from the >queue which is a synchronous operation. The second way is to "subscribe" to a queue and have it asynchronously push messages to the subscriber. You want to investigate this second methodology >for your application. Async operations result in slightly more complex code but they will let you scale better than polling/synchronous operations.
This is news to me. I thought that client has to run the call to fetch the message that is in the client's queue, even if the client subscribes to it. Could you please explain pushing messages to the subscriber. If I have socket server in the middle, will it block the pushed messages? I want to trigger some kind of signal from rabbitmq to the client when a message is waiting for the client so that client doesn't need to poll every few seconds.
Thank you.
On Fri, Sep 18, 2009 at 5:27 AM, Chuck Remes <cremes.devlist@mac.com (cremes.devlist@mac.com)> wrote:
Quote:
On Sep 17, 2009, at 7:40 PM, Alex Gentle wrote:
Quote: >Once you have parsed the message from socket server and determined it >should go to rabbit, you publish the message to it. [/code] |
|
|
| Back to top |
|
| wuji |
Posted: Mon Sep 10, 2012 8:09 am |
|
|
|
User
Joined: 10 Aug 2012
Posts: 654
|
in the suicides.The doctor's mantra was "dying is not a crime," and and imitation designer *beep* and he made national headlines with his invention -- the thanatron, Greek
suicide machine -- which gave patients a "dignified, humane and painless" death."The death."The cheap polo shirts death."The people we were helping, there was never any question in their
said Nicol. "None of the patients ever had a wavering moment in in cheap designer *beep* in their decision."A pull of the trigger released a drug to induce
deep coma. Once asleep, a timer would inject a lethal dose of of buy real jordans of potassium chloride to stop the heart.Later, he used a "mercitron," or
machine, after his medical license was revoked after the first two deaths deaths buy real jordans deaths and he could no longer get the substances required for the
were those in the movement who didn't agree with his methodology," Nicol Nicol cheap replica *beep* Nicol said. "He was thwarted in that goal at every turn, but
did get the message out."He was determined and found it awfully hard hard knockoff designer *beep* hard to understand why people didn't see things as he did," he |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
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
|
|
|