new Thread(PublishMessages).Start();
var serviceBus = ServiceBusFactory.New(configurator => { configurator.DisablePerformanceCounters(); configurator.UseRabbitMq(); configurator.ReceiveFrom(nontransactionalQueueFormat.FormatWith(machineName, assemblyName, "TrafficAnaylyzer")); configurator.SetConcurrentConsumerLimit(5); configurator.Subscribe(subscriptionConfigurator => subscriptionConfigurator.Consumer(() => Kernel.Get<OptInConsumer>()).Transient()); configurator.UseLog4Net(); });
private void PublishMessages() { var serviceBus = _kernel.Get<IServiceBus>(); while (!_shouldStop) { TrafficAnalyzerMessage msg; if (_messageQueue.TryDequeue(out msg)) { serviceBus.Publish(msg); } } }
private void PublishMessages() { var factory = new ConnectionFactory { HostName = "localhost" }; using (var connection = factory.CreateConnection()) { using (var channel = connection.CreateModel()) { channel.QueueDeclare("RulesEngine", true, false, false, null); while (!_shouldStop) { TrafficAnalyzerMessage msg; if (_messageQueue.TryDequeue(out msg)) { var msgString = JsonConvert.SerializeObject(msg); var msgBytes = Encoding.UTF8.GetBytes(msgString); channel.BasicPublish("", "RulesEngine", null, msgBytes); } } } } }
--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/dcfdca4f-faba-444c-bd07-a58d4b8258eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
private void PublishMessages() { var factory = new ConnectionFactory { HostName = "localhost" }; using (var connection = factory.CreateConnection()) { using (var channel = connection.CreateModel()) { channel.QueueDeclare("RulesEngine", true, false, false, null);
channel.ConfirmSelect();
while (!_shouldStop) { TrafficAnalyzerMessage msg; if (_messageQueue.TryDequeue(out msg)) { var msgString = JsonConvert.SerializeObject(msg); var msgBytes = Encoding.UTF8.GetBytes(msgString); channel.BasicPublish("", "RulesEngine", null, msgBytes);
channel.WaitForConfirms(); } } } } }
I would disagree with you. On my single noded dockerized rabbitmq instace i have around 3k publications per second.
--
You received this message because you are subscribed to a topic in the Google Groups "masstransit-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/masstransit-discuss/vUOYgqnVyL8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/0138bf4a-5326-42e4-8cab-7f38dc22c2ed%40googlegroups.com.
3k pubs/sec is actually slow though. Using the raw RabbitMQ client, I can easily hit 10k on a laptop. The point of this thread is that MassTransit is significantly slower than the base RabbitMQ library.
On Tue, Sep 12, 2017 at 5:58 AM, Дмитрий Ушенко <ushenko...@gmail.com> wrote:
I would disagree with you. On my single noded dockerized rabbitmq instace i have around 3k publications per second.
--
You received this message because you are subscribed to a topic in the Google Groups "masstransit-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/masstransit-discuss/vUOYgqnVyL8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/0138bf4a-5326-42e4-8cab-7f38dc22c2ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "masstransit-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/masstransit-discuss/vUOYgqnVyL8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/CANEQmhUU0yRbenSjQie%3DmTZek7WC4199C9ad78XNTXGJdx%3DHtQ%40mail.gmail.com.