3

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 am trying to program it in Java. Are there any SDKs, classes, methods, etc. which can help me with this?

  • Also, if you disagree with creating and destroying a consumer group for each test pass please let me know why.

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

Thanks JD

entpnerd
  • 10,049
  • 8
  • 47
  • 68
user8828251
  • 61
  • 1
  • 1
  • 4

1 Answers1

1

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.

entpnerd
  • 10,049
  • 8
  • 47
  • 68
  • Thank you for link. I had already looked at the library you are pointing to, looked at quickly once again but couldn't find code to create consumer group. Code uses consumer group but doesn't create any place...:(. – user8828251 Oct 25 '17 at 05:20
  • @user8828251 Are you sure you can't create consumer groups? The Consumer Group section I mentioned above explicitly states: "You can create up to 20 such consumer groups on an Event Hub via the Azure portal or the HTTP API." – entpnerd Oct 25 '17 at 12:56
  • I know about REST api [https://learn.microsoft.com/en-us/rest/api/eventhub/consumergroups/createorupdate] call. I am trying to find way to do it directly using some sdk method if possible. I think in .net they have some way using namespace manager. Thought they might have in java as well. Seems not. – user8828251 Oct 25 '17 at 15:35