hi all,
Scenario:
we have configured our azure function endpoint with the outbox feature, using cosmos persistence for a saga.
we have based our implementation using the sample:
Cosmos DB Persistence Usage with transactions • NServiceBus.Persistence.CosmosDB Samples • Particular Docs
as mentioned in the sample, we have all the messages with the IProvideOrderId interface, like below
var transactionInformation = persistence.TransactionInformation();
transactionInformation.ExtractPartitionKeyFromMessage<IProvideOrderId>(provideOrderId =>
{
Log.Info($"Found partition key '{provideOrderId.OrderId}' from '{nameof(IProvideOrderId)}'");
return new PartitionKey(provideOrderId.OrderId.ToString());
});
Issue:
- On this endpoint we implemented a new EmailHandler, which receives a message from a httpfunction trigger that does not implement the IProvideOrderId interface, and we are running into the following exception.
For the outbox to work a partition key must be provided at latest up to the incoming physical or logical message stage. Set one via ‘{nameof(CosmosPersistenceConfig.TransactionInformation)}’.
how can we exclude this particular message to be excluded ?,
httptrigger code for sending the message
var sendOptions = new SendOptions();
sendOptions.RouteToThisEndpoint();
await functionEndpoint.Send(new EmailMessage(Email=emailbody), sendOptions, executionContext);
Thanks -Nen.