[rabbitmq-discuss] Rabbit RPC Application

Bruno Carneiro brunoac88 at gmail.com
Thu Dec 1 17:03:32 GMT 2011


Hello Everybody,

I developed a monitoring application using Rabbit and Rabbit RPC plugin.
I'm monitoring events on my HTML pages and sending messages over HTTP.
What my javascript does is for each event, it opens a channel, send a
message and close that channel. This is the snippet:

 function on_open(channel) {
>
>  channel.queueDeclare(exchangeQueue, false, true, false, false)
>
>     .addCallback( function() {
>
>  channel.basicPublish("", exchangeQueue, exchangeMessage, props);
>
>  channel.close();
>
>  });
>
>    }
>
>
>>    function trackEvent(queue, jsonMsg){
>
>  channel = RabbitMQ.openChannel(on_open, {'exchangeQueue': queue,
>> 'exchangeMessage': jsonMsg});
>
>    }
>
>

When I saw the examples I was wondering what is the best practice using
channel in a browser?
Should I open and close it for each message or should I leave it open and
send messages through this channel?

Thank you!

Cheers,

Bruno Carneiro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111201/cd2a5127/attachment.htm>


More information about the rabbitmq-discuss mailing list