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

Testing code using EventProcessorHost #433

Closed
fredxfred opened this issue Mar 5, 2019 · 8 comments
Closed

Testing code using EventProcessorHost #433

fredxfred opened this issue Mar 5, 2019 · 8 comments

Comments

@fredxfred
Copy link

fredxfred commented Mar 5, 2019

Actual Behavior

  1. You must connect your code using EventProcessorHost to a real EventHub even for testing
  2. This requires operational overhead and makes testing of EventHub-receiving code time consuming

Expected Behavior

  1. There is some testing library we can use to locally emulate the connection between EventProcessorHost and an EventHub/storage account.

It would be really nice to be able to be able to somehow locally emulate an eventhub so that I can test my code using Azure EventHubs locally. Currently, the only way I can fathom to run tests (short of trying to reverse engineer backend logic) is to provision special test resources and write separate code to handle populating those resources with data, which is much more time consuming and complicated than it needs to be. With Kafka, you can create a "cluster" locally, which is very convenient compared to the testing story with Event Hubs.

@fredxfred
Copy link
Author

For example, it would be nice if at least we could create EventData objects with user defined SystemProperties in an easy way.

@JamesBirdsall
Copy link
Contributor

We are aware of the issue. Getting proper mocking in place would make our own testing easier and better, too. The problem is that it's a big work item with only indirect benefits, so it's hard to get on the schedule.

Regarding the specific request to make EventData completely creatable, that is a small enough change that I can probably sneak it into the next release.

@fredxfred
Copy link
Author

Awesome, thank you!

@JamesBirdsall
Copy link
Contributor

@fredxfred See PR #435 -- we already made this change in some of our other SDKs so there should be no issue getting it in here.

@JamesBirdsall
Copy link
Contributor

EventData change released in 2.3.0.

@vivin
Copy link

vivin commented Jun 23, 2021

I would like to vote for this as well. Are there any updates on providing a local/embedded event hub we could use for integration testing?

@JamesBirdsall
Copy link
Contributor

This client is now legacy and deprecated. We will still be making fixes for issues that impact customers in production but we won't be investing in new feature work. The new Java client is at https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/eventhubs/azure-messaging-eventhubs -- opening an issue there with the "Event Hubs" tag will get the attention of the right people.

@vivin
Copy link

vivin commented Jun 24, 2021

Thank you @JamesBirdsall! I will open one there.

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

3 participants