Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

EventHubClient.Send: A message cannot be sent because it is either received from a link or is already sent over a link

There are two EventHubs in same EventHub namespace. I’m using EventHubClient.Send(EventData data) to send events, where both EventHubClient and EventData belong to Azure.Messaging.ServiceBus namespace.

I wish to send the same EventData to both EventHubs belonging to same EventHub namespace. The second EventHub which receives data after the first EventHub, silently drops the data with the following exception:

‘A message cannot be sent because it is either received from a link or is already sent over a link’

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Can someone explain this behavior. I tried to find what this error means, but no luck.

>Solution :

In a nutshell, you cannot send the same EventData instance to multiple entities with the package that you’re using. You would need to create a new instance for each Event Hub.

The legacy package that you’re using tracks the AMQP delivery state as part of EventData. The error that you’re seeing indicates that the internal state sees this event as having already been sent and its delivery finalized.

If you’d prefer not to create a new EventData instance for this scenario, it may be worth considering updating to the current Azure SDK generation. The Azure.Messaging.EventHubs package does not have this limitation.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading