Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: sends various messages autonomously #396

Open
priore opened this issue Jun 4, 2019 · 0 comments
Open

Question: sends various messages autonomously #396

priore opened this issue Jun 4, 2019 · 0 comments

Comments

@priore
Copy link

priore commented Jun 4, 2019

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant