This document is known to be outdated
The following procedure describes the process of building and running the Event Hubs SDK samples (send and send_batch) in a Fedora desktop environment. The samples enable your Fedora machine to act as a device that can connect to an Azure Event Hub.
A computer running the Fedora OS.
To run the sample applications you will need an Event Hub to which they can send messages.
To configure an Event Hub, see Create an Event Hub. Be sure to make a note of the Event Hub name and the SendRule and ReceiveRule connection strings; you will need them to complete building the samples.
-
Open a terminal window in Fedora.
-
Install the prerequisite packages by issuing the following commands in a terminal window:
sudo dnf check-update -y
sudo dnf install -y libcurl-devel openssl-devel libuuid-devel uuid-devel gcc-c++ make cmake git
- Download the SDK to the machine by issuing the following command in your terminal window:
git clone --recursive https://github.com/Azure/azure-event-hubs.git
You will be prompted for your GitHub username and password -- if you have two-factor authentication enabled for your account, you'll need to generate and then use a personal access token in place of your password.
- Verify that you now have a copy of our source code under the directory ~/azure-event-hubs.
Before performing these steps, you'll need the following prerequisite information:
- Event Hub name.
- Event Hub SendRule connection string.
Now, configure the sample:
-
On your Ubuntu machine, open the file ~/azure-event-hubs/c/eventhub_client/samples/send/send.c in a text editor.
-
Scroll down to locate the connection information.
-
Replace the placeholder value for the connectionString variable with your SendRule Event Hub connection string. Replace the placeholder value for the eventHubPath variable with your Event Hub name.
-
Save your changes.
-
Repeat the previous steps, but for step 1 open the file ~/azure-event-hubs/c/eventhub_client/samples/send_batch/send_batch.c.
You can now build the SDK samples using the following command:
~/azure-event-hubs/c/build_all/linux/build.sh
- Run the send sample by issuing the following command:
~/azure-event-hubs/c/eventhub_client/samples/send/linux/send
- Run the send_batch sample by issuing the following command:
~/azure-event-hubs/c/eventhub_client/samples/send_batch/linux/send_batch
- For each sample, verify that the sample output messages show Successful. If not, then you may have incorrectly pasted the Event Hub connection information.
Note: The tools folder in this repository includes the CSharp_ConsumeEventsFromEventHub C# Windows application that can receive messages from an Event Hub. This is useful to help you verify that the samples are sending messages correctly to the Event Hub.