What:
Adding an option to determine message types filter in the following outbox declarations:
mbb.UseOutbox(messageTypeFilter: t => t.Name.EndsWith("Command"));
mbb.UseSqlTransaction(messageTypeFilter: t => t.Name.EndsWith("Command"));
mbb.UseTransactionScope(messageTypeFilter: t => t.Name.EndsWith("Command"));
The filtering happens at configuration time.
Why:
We can have an In-Memory bus for CQRS where only command messages require to be wrapped in a transaction and query messages do not. Without it we would have to declare two memory child buses - for commands and queries.
Optimization:
Moreover, the UseSqlTransaction() will be registered for the enabled message types (consumers, or bus) only.
Before the interceptor was registered DI wide, and interceptor was checking matching consumers at runtime.
What: Adding an option to determine message types filter in the following outbox declarations:
The filtering happens at configuration time.
Why: We can have an In-Memory bus for CQRS where only command messages require to be wrapped in a transaction and query messages do not. Without it we would have to declare two memory child buses - for commands and queries.
Optimization: Moreover, the
UseSqlTransaction()
will be registered for the enabled message types (consumers, or bus) only. Before the interceptor was registered DI wide, and interceptor was checking matching consumers at runtime.