RawRabbit icon indicating copy to clipboard operation
RawRabbit copied to clipboard

Question: sends various messages autonomously

Open priore opened this issue 5 years ago • 0 comments

I didn't understand, I have a client that sends various messages autonomously, it doesn't wait for the ack but it has to send them and that's it, but seems that it send only the first one and all the others only when I close the application.

where am I wrong? what should i set?.

var config = new RawRabbitConfiguration()
                {
                    Username = username,
                    Password = password,
                    VirtualHost = "/",
                    Hostnames = new List<string>() { hostname },
                    AutoCloseConnection = false,
                    //Ssl = new SslOption() {  Enabled = true },
                    Port = port,
                    Exchange = new GeneralExchangeConfiguration
                    {
                        AutoDelete = false,
                        Durable = true,
                        Type = RawRabbit.Configuration.Exchange.ExchangeType.Direct
                    },
                    Queue = new GeneralQueueConfiguration
                    {
                        Exclusive = false,
                        AutoDelete = false,
                        Durable = true
                    }
                };

var options = new RawRabbitOptions() { ClientConfiguration = config };
client = RawRabbitFactory.CreateSingleton(options);

client.SubscribeAsync<MessageModel>(async msg =>
                {
                    return await Task.Run(() => MessageReceived(msg));
                },
                ctx => ctx.UseSubscribeConfiguration(
                    cfg => cfg.FromDeclaredQueue(
                        queue => queue.WithName(queueName))))
                        .GetAwaiter();

priore avatar Jun 04 '19 11:06 priore