Publishing an ISendMyself from a Marten projection's RaiseSideEffects silently drops the message.
public override ValueTask RaiseSideEffects(IDocumentOperations operations, IEventSlice<MyDoc> slice)
{
slice.PublishMessage(new MyUpdated().ToWebSocketGroup(slice.TenantId)); // never reaches the group
slice.PublishMessage(new MyCommand(slice.Id).ToEndpoint("side-effects")); // never reaches the queue
return ValueTask.CompletedTask;
}
MartenToWolverineMessageBatch always passes DeliveryOptions (at least the tenant id) to MessageContext.PublishAsync. MessageBus.PublishAsync only applies an ISendMyself when options == null, so the wrapper is routed as its own type (SignalRMessage<T>, RoutedToEndpointMessage<T>, DeliveryMessage<T>, ...), finds no route, and becomes NoRoutes.
The workaround is an extra local hop: publish a plain message from the projection, and in its handler return the ISendMyself as a cascading message. We carry about 25 of those hops just to push SignalR group notifications from projections.
Publishing an
ISendMyselffrom a Marten projection'sRaiseSideEffectssilently drops the message.MartenToWolverineMessageBatchalways passesDeliveryOptions(at least the tenant id) toMessageContext.PublishAsync.MessageBus.PublishAsynconly applies anISendMyselfwhenoptions == null, so the wrapper is routed as its own type (SignalRMessage<T>,RoutedToEndpointMessage<T>,DeliveryMessage<T>, ...), finds no route, and becomesNoRoutes.The workaround is an extra local hop: publish a plain message from the projection, and in its handler return the
ISendMyselfas a cascading message. We carry about 25 of those hops just to push SignalR group notifications from projections.