user8828251
user8828251

Reputation: 61

How can I create consumer group programmatically for event hub using JAVA?

Scenario: I am trying to create consumer group for Azure Eventhub testing data in event hub. I want to create a consumer group every time I start my tests and destroy it after the tests are completed.

I have seen a similar post for the .NET SDK but couldn't find anything similar for Java. Can someone please help?

Thanks JD

Upvotes: 3

Views: 1223

Answers (1)

Jon Thoms
Jon Thoms

Reputation: 10797

A Java library that may help you is the Azure Event Hubs Java library on Github. With this library, you can create new consumer groups. See the Consumer Groups section of this page for details. As for whether or not I agree with creating and destroying a new consumer group for each test, I don't have an opinion on that. For that one, you might be better off asking on Stack Exchange's Software Engineering site.

Upvotes: 1

Related Questions