Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot send tombstone to azure event hub #44366

Open
3 tasks done
fillsinger opened this issue Feb 24, 2025 · 0 comments
Open
3 tasks done

[BUG] Cannot send tombstone to azure event hub #44366

fillsinger opened this issue Feb 24, 2025 · 0 comments

Comments

@fillsinger
Copy link

fillsinger commented Feb 24, 2025

Describe the bug
According to the Event Hub documentation "Client applications set tombstones by sending a new event with an existing key and a null event payload.”
However, the class com.azure.messaging.eventhubs.EventData does NOT allow to have a null body.

Hence, at the moment it is not possible to send a proper tombstone event to the azure event hub, using the azure sdk for java.

Exception or Stack Trace

java.lang.NullPointerException: 'body' cannot be null.

	at java.base/java.util.Objects.requireNonNull(Objects.java:259)
	at com.azure.messaging.eventhubs.EventData.<init>(EventData.java:64)

To Reproduce
Run the provided code snippet or have a look at the code of the com.azure.messaging.eventhubs.EventData.
There you can see that null is not permitted as a value for body

Code Snippet

try (EventHubProducerClient producer = new EventHubClientBuilder()
                .connectionString("Endpoint=sb://.........", "sandbox")
                .buildProducerClient()) {

            producer.send(List.of(new EventData((byte[]) null)
                    .setMessageId("123")
                    .setContentType("application/avro+MagnoliaPagePublish;version=1")), new SendOptions()
                    .setPartitionKey("0"));

        }

Expected behavior
It is expected to be able to create an event with a null body, in order to provide correct tombstone events to the event hub.

Setup (please complete the following information):

  • OS: iOS 15.3.1
  • IDE: IntelliJ
  • Library/Libraries: azure-messaging-eventhubs:5.20.0, azure-core-amqp:2.9.15
  • Java version: 21

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant