Hi guys,
I've just been debugging some issues I've had with MT + Rabbitmq in a failover cluster behind a netscaler LB.
It looks like when you set the message expiry in MT with SetRequestExpiration and then the RMQ node goes down that the bus was connected to, in the process of retrying (which normally works great and will end up with another connection to the second broker) it ends up with a negative value in the expiration, which rabbitmq dislikes. I'm not 100% sure but it looks like at this point the bus gets into a slightly unrecoverable state.
the error I receive back from RMQ looks like:
709 13:59:11 - Error - Waiting for pending confirms threw an exception RabbitMQ.Client.Exceptions.AlreadyClosedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - invalid expiration '-5296': {value_negative,-5296}", classId=60, methodId=40, cause=
And I've confirmed the negative value comes from:
properties.Expiration =
(value.Kind == DateTimeKind.Utc
? value - SystemUtil.UtcNow
: value - SystemUtil.Now).
TotalMilliseconds.ToString("F0", CultureInfo.InvariantCulture);
...in OutboundRabbitMqTransport:Send
So the 'value' comes out of the send context, so it makes sense that you end up with negative values after the time has taken > expiration I guess.
I've removed all TTLs from our codebase for the time being.
Haven't had chance to try MT3...might be fixed in there.
Cheers,
Tom