Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] PostAsync throws an invalidCast exception with DynamoDB outbox #3112

Open
romtur opened this issue May 22, 2024 · 1 comment
Open

[Bug] PostAsync throws an invalidCast exception with DynamoDB outbox #3112

romtur opened this issue May 22, 2024 · 1 comment
Assignees
Labels
0 - Backlog Bug v10 Allocal to a v10 release

Comments

@romtur
Copy link

romtur commented May 22, 2024

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:
image

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
@romtur
Copy link
Author

romtur commented Jul 2, 2024

Just to let you know, this issue also affects the MySqlOutbox

@iancooper iancooper assigned iancooper and unassigned iancooper Jul 10, 2024
@iancooper iancooper added the v10 Allocal to a v10 release label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog Bug v10 Allocal to a v10 release
Projects
None yet
Development

No branches or pull requests

2 participants