-
Notifications
You must be signed in to change notification settings - Fork 39
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
Is it possible to use different DbContext for different Outbound messages to use Outbox pattern? #163
Comments
It's currently not possible. The configuration will become more flexible in Silverback 4 and allow for this scenario (sneak-peak: https://github.com/BEagle1984/silverback/blob/release/4.0.0/tests/Silverback.Integration.Tests.E2E/Kafka/OutboxFixture.cs#L56) but we are still a bit far from the delivery date (which I cannot even estimate at the moment). In your case, it would probably make sense to have a DbContext dedicated to the Silverback tables and use that across all your modules/features. Then you can use an ambient transaction (using the |
Thank you for answer. Unfortunately, TransactionScope makes impossible to use different databases in different modules. |
Why? |
As you say "not all drivers support the ambient transactions" |
Does silverback support TransactionScope? |
The transaction is only a database thing, Silverback supports what the underlying database driver library supports. If you use MSSQL, it surely works. If you use something different just have a look at the driver's documentation to know if it's supported. |
The application is designed as a modular monolith. Where each module communicates with another via kafka. Therefore, there are multiple DbContexts in one project. I want to use the Outbox pattern, but the problem is that can only specify 1 DbContext
The text was updated successfully, but these errors were encountered: