27

I am looking to start a new project using Azure Event Hubs. Part of the project is a set of integration tests that can be run from any development machine (plus CI). In the past, I've used the local emulators (e.g., Cosmos DB, Storage, Service Fabric, etc.) for this purpose. That way dev machines don't need real cloud credentials and have an isolated environment. However, it appears that Event Hubs do not have a local emulator.

Is there an Event Hubs emulator that I missed? If not, would a AMQP service be a good alternative? Are there any that would be decent approximation for Event Hubs?

Thanks


I created a feedback item for this. Please vote it up if this would be useful to you!

https://feedback.azure.com/forums/34192--general-feedback/suggestions/31852534-provide-a-local-emulator-for-azure-event-hubs

Erick T
  • 7,009
  • 9
  • 50
  • 85

2 Answers2

11

Azure Event Hubs does not have an emulator that can be installed locally. You'll need to create an Event Hubs instance in Azure and use that for development and testing purposes.

Chris Pietschmann
  • 29,502
  • 35
  • 121
  • 166
  • 2
    @AndyBrown: It is probably downvoted because setting up something in Azure is not an answer to the question. The question is about local development and testing in an isolated environment. – Lars Christian Jensen Aug 07 '19 at 13:56
  • For a very specific case (building a NodeJS or Typescript Azure Function app) I've been using this method to make a local process receive EventHub messages (emulating EventHub's AMQP interface), which will ingest them into a Redis Stream, and then this uses an HTTP triggered function as a "hack" to trigger the EventHub-triggered functions: https://github.com/OpenLearningNet/local-node-eventhub-trigger I'm open to anyone helping extend the functionality here so that it works across more use cases. Currently I don't know enough about the EventHub inner workings. – dcollien Nov 04 '19 at 02:48
  • 1
    testing MS Azure / synapse is totally broken presently. I upvoted because "don't shoot the messenger" – WestCoastProjects Dec 30 '22 at 16:14
7

One option is to connect to the Kafka endpoint, and test your application as a Kafka application.

https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-for-kafka-ecosystem-overview

It may not be elegant, but apparently there aren't many good options out there. It will at least make it easier to migrate to Kafka later, if needed.

Lars Christian Jensen
  • 1,407
  • 1
  • 13
  • 14