ServiceBus fails to send messages if folder contains Microsoft.Azure.Amqp version 2.5.8 instead of 2.5.6
See original GitHub issueThe following exception is thrown when output folder contains Microsoft.Azure.Amqp version= 2.5.8 and 'Azure.Messaging.ServiceBus version=7.5.1.0:
The type initializer for ‘Azure.Messaging.ServiceBus.Amqp.AmqpTransactionManager’ threw an exception.
—> System.TypeInitializationException: The type initializer for ‘Azure.Messaging.ServiceBus.Amqp.AmqpTransactionManager’ threw an exception.
—> System.TypeLoadException: Method ‘OnCreateAsync’ in type ‘Azure.Messaging.ServiceBus.Amqp.AmqpTransactionEnlistment’ from assembly ‘Azure.Messaging.ServiceBus, Version=7.5.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8’ does not have an implementation.
at Azure.Messaging.ServiceBus.Amqp.AmqpTransactionManager…ctor()
at Azure.Messaging.ServiceBus.Amqp.AmqpTransactionManager…cctor()
— End of inner exception stack trace —
at Azure.Messaging.ServiceBus.Amqp.AmqpTransactionManager.get_Instance()
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.SendBatchInternalAsync(IEnumerable1 messages, TimeSpan timeout, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.Amqp.AmqpSender.SendBatchInternalAsync(IEnumerable
1 messages, TimeSpan timeout, CancellationToken cancellationToken)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<SendBatchAsync>b__18_0>d.MoveNext()
— End of stack trace from previous location —
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<>c__201.<<RunOperation>b__20_0>d.MoveNext() --- End of stack trace from previous location --- at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.RunOperation[T1,TResult](Func
4 operation, T1 t1, TransportConnectionScope scope, CancellationToken cancellationToken)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.RunOperation[T1,TResult](Func4 operation, T1 t1, TransportConnectionScope scope, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.RunOperation[T1](Func
4 operation, T1 t1, TransportConnectionScope scope, CancellationToken cancellationToken)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.SendBatchAsync(ServiceBusMessageBatch messageBatch, CancellationToken cancellationToken)
at Azure.Messaging.ServiceBus.ServiceBusSender.SendMessagesAsync(ServiceBusMessageBatch messageBatch, CancellationToken cancellationToken)
This is because after version 2.5.6 Microsoft.Azure.Amqp contains breaking change: base class named Singleton changed OnCreateAsync method parameters and Azure.Messaging.ServiceBus.Amqp.AmqpTransactionManager cannot be instantiated anymore as abstract method is not implemented.
Note that assembly version of Microsoft.Azure.Amqp did not change at all. I don’t think it is correct way to do breaking changes.
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (8 by maintainers)
Top GitHub Comments
Looks like this was a breaking change in the
Microsoft.Azure.Amqp
library, introduced in v2.5.7 by this commit. I’ll open an issue in the repository where the AMQP package is maintained and also reach out to the team that owns the package to see if they’re able to make a patch release.In the meantime, are you able to revert to v2.5.6 of the AMQP package?
SBRepro.zip here is a test project