Rabbit 3.7.14 with masstransit failover doesn't work

264 views
Skip to first unread message

rahul sen

unread,
Jun 5, 2019, 1:41:47 PM6/5/19
to masstransit-discuss
Hi,
I have 2 servers TestServer1(primary) and Testserver2, which have rabbitmq 3.7.14 installed on it.
My publisher and subscriber apps refer to testserver1 to the virtual host 'messages'. Following are the policies set for the virtual host:
ha-mode: all
ha-promote-on-failure: always
ha-promote-on-shutdown: always
queue-mode: lazy
When I stop the service in testserver1, the subscriber application shuts down immediately.I think thats how its designed.
Also I get the following error:

MassTransit.Messages Warning: 0 : S-FAULT rabbitmq://TestServer1/messages/Infrastructure.Messaging.Core1:BusMessage--Infrastructure.Messaging.Sample.Contracts:SerialNumber-- 00010000-4100-0250-f518-08d6e9c4fcac Infrastructure.Messaging.Core1.BusMessage<Infrastructure.Messaging.Sample.Contracts.SerialNumber> Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=320, text="CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'", classId=0, methodId=0, cause=, RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=320, text="CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'", classId=0, methodId=0, cause=
at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)
at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.PublishAsync(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.<>c__DisplayClass12_0.<MassTransit.RabbitMqTransport.ModelContext.BasicPublishAsync>b__1()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.MassTransit.RabbitMqTransport.ModelContext.BasicPublishAsync(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body, Boolean awaitAck)
at MassTransit.Internals.Extensions.TaskExtensions.WithCancellation(Task task, CancellationToken cancellationToken)
at MassTransit.RabbitMqTransport.Transport.RabbitMqSendTransport.<>c__DisplayClass7_0`1.<<MassTransit-Transports-ISendTransport-Send>b__1>d.MoveNext()
MassTransit.Messages Warning: 0 : S-FAULT rabbitmq://TestServer1/messages/Infrastructure.Messaging.Core1:BusMessage--Infrastructure.Messaging.Sample.Contracts:SerialNumber-- 00010000-4100-0250-d956-08d6e9c4fcac Infrastructure.Messaging.Core1.BusMessage<Infrastructure.Messaging.Sample.Contracts.SerialNumber> Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=320, text="CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'", classId=0, methodId=0, cause=, RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=320, text="CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'", classId=0, methodId=0, cause=
at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)
at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.PublishAsync(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.<>c__DisplayClass12_0.<MassTransit.RabbitMqTransport.ModelContext.BasicPublishAsync>b__1()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.MassTransit.RabbitMqTransport.ModelContext.BasicPublishAsync(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body, Boolean awaitAck)
at MassTransit.Internals.Extensions.TaskExtensions.WithCancellation(Task task, CancellationToken cancellationToken)
at MassTransit.RabbitMqTransport.Transport.RabbitMqSendTransport.<>c__DisplayClass7_0`1.<<MassTransit-Transports-ISendTransport-Send>b__1>d.MoveNext()
MassTransit.Messages Warning: 0 : S-FAULT rabbitmq://TestServer1/messages/Infrastructure.Messaging.Core1:BusMessage--Infrastructure.Messaging.Sample.Contracts:SerialNumber-- 00010000-4100-0250-cdfb-08d6e9c4fcac Infrastructure.Messaging.Core1.BusMessage<Infrastructure.Messaging.Sample.Contracts.SerialNumber> Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=320, text="CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'", classId=0, methodId=0, cause=, RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=320, text="CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'", classId=0, methodId=0, cause=
at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)
at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.PublishAsync(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at MassTransit.RabbitMqTransport.Contexts.RabbitMqModelContext.<>c__DisplayClass12_0.<MassTransit.RabbitMqTransport.ModelContext.BasicPublishAsync>b__1()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace


If primary mode testserver1 shuts down, I want messages to publish to testserver2 seamlessly. That is not clearly happening in our case.
The publisher after a few errors continues to publish but the mirrored queue in testserver2 is empty . please help.

rahul sen

unread,
Jun 6, 2019, 8:22:48 AM6/6/19
to masstransit-discuss
Hi team, kindly help . waiting for your inputs. If any more details is needed, please let me know. Will HAProxy help ?

Niklas Gåfvels

unread,
Jun 12, 2019, 5:25:22 AM6/12/19
to masstransit-discuss
Did you use IRabbitMqHostConfigurator.UseCluster with calls to IRabbitMqClusterConfigurator.Node on the host? 
Reply all
Reply to author
Forward
0 new messages