Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 2k forks source link

[QUERY] Is Azure EventHub send operation synchronous? #29666

Closed YairoR closed 2 years ago

YairoR commented 2 years ago

Query/Question Hi,

We're using the azure-messaging-eventhubs SDK 'send' method to send a single event to Event Hub: image

Everything worked just fine, but we've observed that in the last few days some messages didn't get to the Event Hub although no exception was thrown. We've also identified traces of 'java.lang.OutOfMemoryError: Java heap space' coming from the process (not directly from Event Hub SDK).

While going over the existing issues, I saw that a memory bug was fixed at version 5.10 while we're currently using 5.5 (due to dependencies issues), so this might caused the OutOfMemoryException. My question is - according to the documentation, the 'send' operation should be synchronous, but in our case, we had missing messages and no exception was thrown. Is that by design? Maybe related to the old maven package version?

Why is this not a Bug or a feature Request? I'm not sure it's a bug, might be something on our side.

Setup (please complete the following information if applicable):

joshfree commented 2 years ago

Hi @YairoR thanks for reaching out to us via GitHub. @conniey could you please follow up?

conniey commented 2 years ago

Yes, if you are using the EventHubProducerClient when the send operation returns control, the Event Hub service has acknowledged receiving the message.

YairoR commented 2 years ago

Thanks @conniey. Another related question - is it mandatory to install both 'azure-sdk-bom' and 'azure-messaging-eventhubs' packages?

In this doc - https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-java-get-started-send it's only mentioned to install the 'azure-messaging-eventhubs' package, but in this doc - https://docs.microsoft.com/en-us/java/api/overview/azure/messaging-eventhubs-readme?view=azure-java-stable it's mentioned to install both 'azure-messaging-eventhubs' and 'azure-sdk-bom' packages.

YairoR commented 2 years ago

@conniey Ping :)

conniey commented 2 years ago

Hey @YairoR , thanks for the ping.

The azure-sdk-bom is a great way to ensure that all the versions of our client library are compatible. For example, if you also use the Azure Storage Blob and Azure Cosmos client libraries, and want to ensure that there are no conflicting dependencies between it and azure-messaging-eventhubs.

We release on a monthly cadence and noticed that sometimes customers picked a library released in June, another library released in March, then found runtime dependency conflicts because our shared azure-core library might have some changes underneath.

I hope this answers your question.