Using Event Hubs

Event Hubs provides an endpoint compatible with the Apache Kafka producer and consumer APIs that can be used by most existing Apache Kafka client applications as an alternative to running your own Apache Kafka cluster.

Event Hubs supports Apache Kafka's producer and consumer APIs clients at version 1.0 and above. 

You can configure the Kafka account to use Event Hubs by defining a set of properties in the Addon Configuration field. Follow the steps below to use Event Hub.

  1. Click Configure > ACCOUNTS > Kafka.  

  2. Click Create Kafka account
  3. In Create Kafka Account screen, do the followings:

    1. In the Name and Description fields, enter the name and description respectively for the new Kafka account.
    2. In the Brokers field, enter the URL of the Kafka brokers, for example, host1:port1,host2:port2.

    3. Leave the default value (PLAINTEXT) as is in the Security Protocol field. This shall be overwritten with what you're going to define in the Addon Configuration field.

    4. In the Addon Configuration field, set the saslMechanismsecurityProtocolsaslJaasConfig properties as shown in the following example. 

      Define each property in a new line.

      saslMechanism=PLAIN
      
      securityProtocol=SASL_SSL
      
      saslJaasConfig=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://adeptia-serviceseventhubs.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Q6k6CuSF5vp60mpul+I72MK7Gi1zl6bh5cg2zLKiWb4=";

      The table below describes the properties and their values:

      Property key

      Description

      saslMechanism

      The SASL mechanism you want to use. For the valid values, click here.

      securityProtocol

      Protocol (SASL_SSL) used for communicating with brokers.

      saslJaasConfig

      The property for exposing the Kafka sasl.jaas.config parameters as shown in the example.

    5. In the Select Project field, select the project.
    6. Click Save.