Describe the bug
An InvalidCastException is thrown when calling PostAsync with a DynamoDB outbox. However, it works correctly when calling DepositPostAsync while providing an IAmADynamoDbTransactionProvider
To Reproduce
Setup a DynamoDB outbox:
brighterBuilder.UseExternalBus((configure) =>
{
configure.ProducerRegistry = new KafkaProducerRegistryFactory(kafkaConfiguration, publications).Create();
configure.Outbox = new DynamoDbOutbox(dynamoDBClient, new DynamoDbConfiguration());
configure.TransactionProvider = typeof(DynamoDbUnitOfWork);
configure.ConnectionProvider = typeof(DynamoDbUnitOfWork);
});
Call PostAsync method
The failure occurs in CommandProcessor:

Link to original discussion: #3091
Exceptions (if any)
System.InvalidCastException: Unable to cast object of type 'Paramore.Brighter.ExternalBusServices2[Paramore.Brighter.Message,Amazon.DynamoDBv2.Model.TransactWriteItemsRequest]' to type 'Paramore.Brighter.ExternalBusServices2[Paramore.Brighter.Message,System.Transactions.CommittableTransaction]'
Further technical details
- Brighter version: 1.0.0-preview.3
- The OS: Windows
- Kafka
Describe the bug
An InvalidCastException is thrown when calling PostAsync with a DynamoDB outbox. However, it works correctly when calling DepositPostAsync while providing an IAmADynamoDbTransactionProvider
To Reproduce
Setup a DynamoDB outbox:
Call PostAsync method
The failure occurs in CommandProcessor:

Link to original discussion: #3091
Exceptions (if any)
Further technical details