question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ServiceBus fails to send messages if folder contains Microsoft.Azure.Amqp version 2.5.8 instead of 2.5.6

See original GitHub issue

The 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(IEnumerable1 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](Func4 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](Func4 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:closed
  • Created 2 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jsquirecommented, Jan 7, 2022

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?

1reaction
klioqccommented, Jan 7, 2022

SBRepro.zip here is a test project

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot AMQP errors in Azure Service Bus
This article provides some of the errors you receive when using AMQP with Azure Service Bus. They're all standard behaviors of the service....
Read more >
Azure Service Bus - Receive Message fails with following ...
I have implemented Azure Service Bus, and it fails with following exception. This happens randomly, not always. Send operation works fine ...
Read more >
Azure Service Bus frequently asked questions (FAQ)
This article provides answers to some of the frequently asked questions (FAQ) about Azure Service Bus.
Read more >
Troubleshooting guide for Azure Service Bus
This article provides troubleshooting tips and recommendations for a few issues that you may see when using Azure Service Bus.
Read more >
Azure Service Bus Exception : Cannot allocate more ...
I have n numbers of azure functions getting invoked and sending messages to topics. Meanwhile I get below exception: Cannot allocate more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found