[rabbitmq-discuss] RabbitMQ callback using some listener
Rafael
manjay.bit2k7 at gmail.com
Wed Apr 9 12:39:04 BST 2014
Apology if it's very basic question. I am new to RabbitMQ.
I have one requirement where My receiver should be notified if There is
something written in Queue by sender. I don't want to implement a solution
where I will check every time in queue and if its there I will deque.
I dont want like this where I will check every time in a queue rather
please provide some solution where I will get notification while something
written in queue.
while (true)
{var ea =(BasicDeliverEventArgs)consumer.Queue.Dequeue();var body = ea.Body;var message = Encoding.UTF8.GetString(body);Console.WriteLine(" [x] Received {0}", message);
int dots = message.Split('.').Length - 1;Thread.Sleep(dots * 1000);
Console.WriteLine(" [x] Done");
channel.BasicAck(ea.DeliveryTag, false);
}
Thanks in Advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140409/f7e9ee1a/attachment.html>
More information about the rabbitmq-discuss
mailing list