Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Rising Star

To post random data to Azure Event hubs using HTTP, use a generate flowfile processor to first generate the random data. Connect this to an UpdateAttribute processor to add your SAS (Share Access Signature) as a new attribute called "Authorization" to the flow file's attributes. Finally use PostHTTP to submit the data to Event Hubs

Place the following processors on the pallet and set the run schedule of the generate flowfile processor to something reasonable like 10 seconds.

10066-processors.png

Configure Update Attribute, adding the "Authorized" property with a SAS token. For more information on creating a SAS token see https://community.hortonworks.com/articles/69823/creating-shared-access-signature-sas-for-posting-d....

10068-update-attribute.png

Configure the PostHTTP to post the URL https://eventhub-nifi.servicebus.windows.net/hub-nifi/messages

10069-posthttp.png

Note: I set the content type to text/plain you should set this to suit your use case.

Only the truststore needs to be configured for this example as we only need to trust the server certificates presented to us by the Azure servers. For simplicity I use Java's default keystore. See this post for finding and configuring the SSL service to use this keystore. Otherwise you will need to import trust certificates into your keystore manually

Start all processors and verify successful submissions to the Event Hub Service in the Azure Portal

10070-azuredetails.png

Background on the security mechanisms of Event Hubs

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-shared-access-signature-aut...

Background on Shard Access Signatures and how to generate them

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas-overview


update-attribute.png
10,440 Views