Discussion:
[rabbitmq-users] subscribe to message Queue
s***@gmail.com
2015-07-30 16:05:05 UTC
Permalink
Hi,
I have built a sender and consumer apps to send and consume messages
respectively, the question is how do I make my consumer app listening on
the message queue to consume the message automatically, I am new to Rabbit
MQ...tx
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-07-30 16:33:36 UTC
Permalink
Declare the queue(s) you need and add consumers to them, all when the consuming app boots?

MK
I have built a sender and consumer apps to send and consume messages respectively, the question is how do I make my consumer app listening on the message queue to consume the message automatically, I am new to Rabbit MQ...tx
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-07-30 17:09:03 UTC
Permalink
let me clarify,the queue has been declared and bound to an exchange, I have
successfully posted several messages to the queue and subsequently running
my app to consume the message, the issue I am facing is how do I make my
consuming app consume the message automatically without having to invoke it
every time
Post by Michael Klishin
Declare the queue(s) you need and add consumers to them, all when the consuming app boots?
MK
Post by s***@gmail.com
I have built a sender and consumer apps to send and consume messages
respectively, the question is how do I make my consumer app listening on
the message queue to consume the message automatically, I am new to Rabbit
MQ...tx
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-07-30 17:22:11 UTC
Permalink
Post by s***@gmail.com
let me clarify,the queue has been declared and bound to an exchange,
I have successfully posted several messages to the queue and
subsequently running my app to consume the message, the issue
I am facing is how do I make my consuming app consume the message
automatically without having to invoke it every time
Having to invoke *what* every time? What client do you use?
What's your code like?

The primary way to consume messages with RabbitMQ is by registering
a subscription. Then messages will be pushed from the server to your client. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-07-30 18:31:20 UTC
Permalink
Here is my codes...tx


public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}

protected override void OnStart(string[] args)
{
var factory = new ConnectionFactory() { HostName = "localhost"
};

using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
var consumer = new QueueingBasicConsumer(channel);
var subscription = new Subscription(channel,
"QMS_Queue");
subscription.Next();
channel.BasicConsume("QMS_Queue", true, consumer);

while (true)
{
var ea =
(BasicDeliverEventArgs)consumer.Queue.Dequeue();
var body = ea.Body;
var message = Encoding.UTF8.GetString(body);
Console.WriteLine(" [x] recieve {0}", message);
}
}
}
}
protected override void OnStop()
{
}

}
}
Post by Michael Klishin
Post by s***@gmail.com
let me clarify,the queue has been declared and bound to an exchange,
I have successfully posted several messages to the queue and
subsequently running my app to consume the message, the issue
I am facing is how do I make my consuming app consume the message
automatically without having to invoke it every time
Having to invoke *what* every time? What client do you use?
What's your code like?
The primary way to consume messages with RabbitMQ is by registering
a subscription. Then messages will be pushed from the server to your
client.
--
MK
Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-07-30 18:42:47 UTC
Permalink
Post by s***@gmail.com
Here is my codes...tx
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
var factory = new ConnectionFactory() { HostName = "localhost"
};
using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
var consumer = new QueueingBasicConsumer(channel);
var subscription = new Subscription(channel, "QMS_Queue");
subscription.Next();
channel.BasicConsume("QMS_Queue", true, consumer);
while (true)
{
var ea = (BasicDeliverEventArgs)consumer.Queue.Dequeue();
var body = ea.Body;
var message = Encoding.UTF8.GetString(body);
Console.WriteLine(" [x] recieve {0}", message);
}
}
}
}
protected override void OnStop()
{
}
}
}
And what exactly would you like to do "automatically"? You add a consumer
and it will get deliveries as messages are published, according to the channel's QoS
(covered in tutorial 2).

Note that we've just switched our tutorials away from the queueing consumer.
It is no longer relevant in most cases (in 3.5.x) and cannot be recovered automatically.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-07-30 20:30:28 UTC
Permalink
Thanks, btw, how do I add a consumer using the RabbitMQ UI
Post by Michael Klishin
Post by s***@gmail.com
Here is my codes...tx
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
var factory = new ConnectionFactory() { HostName = "localhost"
};
using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
var consumer = new QueueingBasicConsumer(channel);
var subscription = new Subscription(channel, "QMS_Queue");
subscription.Next();
channel.BasicConsume("QMS_Queue", true, consumer);
while (true)
{
var ea = (BasicDeliverEventArgs)consumer.Queue.Dequeue();
var body = ea.Body;
var message = Encoding.UTF8.GetString(body);
Console.WriteLine(" [x] recieve {0}", message);
}
}
}
}
protected override void OnStop()
{
}
}
}
And what exactly would you like to do "automatically"? You add a consumer
and it will get deliveries as messages are published, according to the channel's QoS
(covered in tutorial 2).
Note that we've just switched our tutorials away from the queueing consumer.
It is no longer relevant in most cases (in 3.5.x) and cannot be recovered automatically.
--
MK
Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-07-30 22:22:13 UTC
Permalink
Post by s***@gmail.com
Thanks, btw, how do I add a consumer using the RabbitMQ UI
You can't. A consumer is a piece of executable logic (e.g. a function or an object
that adheres to a specific interface) more commonly executed in your apps. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2015-07-31 15:36:27 UTC
Permalink
Thank You...
On a different topic, I was planning to have corporate training on RabbitMQ
and other development related topics for me and some of my team members,
had sent out an email but receive no response, can you reference a point of
contact.
Post by Michael Klishin
Post by s***@gmail.com
Thanks, btw, how do I add a consumer using the RabbitMQ UI
You can't. A consumer is a piece of executable logic (e.g. a function or an object
that adheres to a specific interface) more commonly executed in your
apps.
--
MK
Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-07-31 15:38:18 UTC
Permalink
Post by s***@gmail.com
On a different topic, I was planning to have corporate training
on RabbitMQ and other development related topics for me and some
of my team members, had sent out an email but receive no response,
can you reference a point of contact.
Please contact ***@rabbitmq.com (again, if you contacted it originally)
and mention where your company is based.

Thank you!
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-07-31 15:46:53 UTC
Permalink
Post by Michael Klishin
it originally)
and mention where your company is based.
Doh, it's ***@rabbitmq.com, not support.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...