Skip to content

IInboxMessageSink

interface

Namespace: Orleans.Durable.Messaging

Accepts delivered messages directly into application-owned journaled state, so their payload is journaled once.
public interface IInboxMessageSink

Remarks

After validation and deduplication, the inbox offers each message to the registered sinks in registration order, including messages the grain sends to itself and messages with Envelope. The first sink which takes the message decides its DeliveryResult. A sink which reports Accepted has synchronously staged the message's effects in its own journaled state. The inbox then journals only the message's processed record, without its payload, in the same journal write, and reports the result once that write is durable. Run effects which depend on the write, such as starting work, from IStateMachine.

A sink-owned message never occupies inbox capacity and has no inbox retry lifecycle: the sink owns its processing, including honoring the message's Envelope. Messages which every sink declines are accepted by the inbox and dispatched to IInboxHandler instances once their Envelope has passed; decline a scheduled message to have the inbox hold it until then.

Sinks must be idempotent. The inbox deduplicates the message ID while it retains the processed record, for DeduplicationWindow after the message's InboxMessage. Delayed retries after that receive DeliveryResult before reaching a sink. A message whose journal write fails is redelivered to the next activation, which recovers the sink's state from the journal.

Methods