如何在事务范围内调用服务总线 azure
How to call service bus azure in transactionscope
当我在 Azure 服务总线上调用 MassTransit.Publish 时,出现异常,因为调用在 TransactionScope 中。
The feature 'Transaction' is not supported with the current configuration
如何在没有事务模式的情况下在事务范围内在总线上发送消息?
我不想要总线事务,只想要数据库事务。
谢谢。
您可以在交易完成后使用内存发件箱进行发送。
cfg.ReceiveEndpoint(host, "my-queue", e =>
{
e.UseInMemoryOutbox();
e.Consumer<MyConsumer>(...);
});
对于配置,顺序很重要,因此如果您使用 Retry 或其他中间件组件,它应该位于配置中的内存发件箱之前。您的消费者应该是所有中间件组件之后。
当我在 Azure 服务总线上调用 MassTransit.Publish 时,出现异常,因为调用在 TransactionScope 中。
The feature 'Transaction' is not supported with the current configuration
如何在没有事务模式的情况下在事务范围内在总线上发送消息? 我不想要总线事务,只想要数据库事务。
谢谢。
您可以在交易完成后使用内存发件箱进行发送。
cfg.ReceiveEndpoint(host, "my-queue", e =>
{
e.UseInMemoryOutbox();
e.Consumer<MyConsumer>(...);
});
对于配置,顺序很重要,因此如果您使用 Retry 或其他中间件组件,它应该位于配置中的内存发件箱之前。您的消费者应该是所有中间件组件之后。