MessageHandler MH Sign Up

Event Generator Quickstart


This quickstart gives you an example implementation of an event generator.


Clone the source code from Github before you get started.


In this scenario the event generator measures changes in 'data downloaded' by your WIFI and generates an event to report it.

What you need to get started

Running the sample

Prior to being able to run the sample, you need to configure the user secrets file.

In the secrets file you must specify the following configuration values.

  "eventhubsnamespace": "your event hubs connection string goes here"

Also ensure an event hub named receivehub is created up front in the eventhubs namespace.

Once configured you can start the worker or run the unittests.

Designed with testing in mind

MessageHandler is intented to be test friendly.

This sample contains plenty of ideas on how to test dispatching from an event generator without requiring a dependency on an actual broker instance, and thus keep the tests fast.

  • Component tests: To test the interaction between the event generator and the dispatching infrastructure.
  • Contract tests: To verify that the test doubles used in the component tests are behaving the same as an actual dependency would. Note: contract verification files are often shared between producers and consumers of the contract.

How to implement it yourself

Check out this how to guide to learn how to dispatch messages using the buffered dispatcher.

Sign up to our newsletter to get notified about new content and releases

You can unsubscribe at any time by clicking the link in the footer of your emails. I use Mailchimp as my marketing platform. By clicking subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.