Hello
I am trying to get new messages from RabbitMQ using windows service but event of recieving new message doesn't accure. This service could be launched as Console Application in Debug Mode. In this case the event occures and I get new messages. The service is launched with the user I use to log into Windows. This is a part of code with event handling
var factory = new ConnectionFactory() { HostName = "localhost" };
using (var conn = factory.CreateConnection())
{
using (var channel = conn.CreateModel())
{
channel.ExchangeDeclare("sm_posts", "fanout");
var argu = new Dictionary<string, object>();
argu.Add("x-max-length", 10000);
var consumerQueue = channel.QueueDeclare().QueueName;
channel.QueueBind(queue: consumerQueue, exchange: "sm_posts", routingKey: "");
var consumer = new EventingBasicConsumer(channel);
log.Info("Waiting for new messages...");
consumer.Received += (model, ea) =>
{
count++;
var body = ea.Body;
var message = Encoding.UTF8.GetString(body);
log.Info(message + "\n\n\n\n\n");
So, why windows service doesn't get messages and if it is launched as Console application in Debug Mode it gets messages? Thanks
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--MKStaff Software Engineer, Pivotal/RabbitMQ
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--MKStaff Software Engineer, Pivotal/RabbitMQ
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.