NServiceBus/NServiceBus — Issue #145: TimeToBeReceived attribute has no affect without explicit endpoint config
Author: aluetjen
Created: 2011-10-31 15:21:09+00:00
State: open

The TimeToBeReceived attribute on a message has no affect if there is no explicit endpoint configured for the message type. Issue reproduced in NSB 2.6.

There is a message:

[TimeToBeReceived("0:00:05.000")]
public class TestMessage : IMessage
...

Which is sent:

_bus.Send("ANoneExistingQueue@AMachineFarAway", m => { });

Result: the message stays in the out queue for more than 5 seconds.

Cause: RegisterMessageType of UnicastBus sets the TTLs per message type. However, it is only called for explicit message endpoints.

Workaround: add to your config.