Overview

What is Event Hub?

Please see Event Hubs - Cloud big data solutions | Microsoft Azure.

What Event Hub service does

Supported

Not yet supported

How Event Hub service works

image alt text

Preparation

Please note that Event Hub service only requires a valid Event Hub entity. It doesn’t have to be associated with a Data Lake. This guide is provided so that it’s easier to verify that your event has arrived at Event Hub in the quickstart section later.

Please follow Capture data to an Azure Data Lake Store account to create an Event Hub that is associated with a Data Lake.

Quickstart

Add Event Hub service to your Business

Subscribe to Event Hub service in Exchange for your Application Solution. If you are not familiar with Murano’s Exchange Element, you can refer to this doc: Adding Exchange Elements.

Configure Event Hub service

image alt text

Please ensure all the fields filled in step 4 through 7 are correct. Otherwise your call to EventHub.send in the Lua scripts won’t work.

  1. Click Eventhub in the service list
  2. Click the dango icon, and then + New Item in the popup menu
  3. Fill this in with an ID. This id will be used later in your lua script with the EventHub.send function.
  4. Fill in the SAS key. This key needs to have send permission, and you can find it in the next image at number 1
  5. Fill in the Event Hub entity name to be used when the EventHub.send function doesn't return one. You can find it at number 2 in the next image.
  6. Fill in the Event Hub namespace, you can find it at 3 in the next image
  7. Fill in the SAS Key name, you can find it at 4 in the next image
  8. Click APPLY

image alt text

Create an Endpoint to send event

image alt text

  1. Click ROUTES
  2. Click + NEW ENDPOINT Select POST from Select Method Fill eventhubdemo in Path Click CREATE
  3. Paste the following in the code editor:
    return Eventhub.send({
    id = 'eventhubdemo',
    event_data = to_json(request.body)})
    
  4. Click SAVE

Note: In Step 3, you could also provide an optional event_hub key to override the default event_hub in the service config or provide an optional publisher key to denote the publisher. See the following snippet for example:

return Eventhub.send({
  id = 'eventhubdemo',
  event_data = to_json(request.body),
  event_hub = 'eventhubdemo2',
  publisher = 'eventhubdemopublisher'})

Send event to Event Hub

Please paste the following to your terminal:

curl -X POST \
  https://eventhubdemo.apps.exosite.io/eventhubdemo \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"hello":"eventhubdemo"}'

The response should look like:

{"body":"","headers":{"Content-Type":"application/xml; charset=utf-8","Date":"Thu, 19 Oct 2017 06:10:12 GMT","Server":"Microsoft-HTTPAPI/2.0","Strict-Transport-Security":"max-age=31536000","Transfer-Encoding":"chunked"},"status_code":201}

See event on Data Lake

image alt text

  1. Browse to the captured data through the Data Explorer

  2. Click the file

image alt text

We can see that the data is indeed there.