# IInboxMessageSink

Package: [Microsoft.Orleans.Durable](/orleans/docs/api/csharp/microsoft.orleans.durable/) 10.0.0-alpha.1

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/Messaging/IInboxMessageSink.cs#L29)

```csharp
public interface IInboxMessageSink
```

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

## 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](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.envelope/). The first sink which takes the message decides its [DeliveryResult](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.deliveryresult/). A sink which reports [Accepted](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.deliveryresult.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](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.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](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.envelope/). Messages which every sink declines are accepted by the inbox and dispatched to [IInboxHandler](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.iinboxhandler/) instances once their [Envelope](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.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](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.inboxmessage/). Delayed retries after that receive [DeliveryResult](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.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

- [TryAccept(InboxMessage, DeliveryResult)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.iinboxmessagesink/methods/tryaccept-orleans-durable-messaging-inboxmessage-out-orleans-durable-messaging-d-af442ecb/)
