Add a custom endpoint or custom app destination to an eventstream

If you want to connect your own application with an eventstream, you can add a custom endpoint or a custom app as a destination. Then you can consume real-time events from the eventstream to your own application with the connection endpoint exposed on the custom endpoint or custom app. Also, with the Apache Kafka protocol available as an option for custom endpoints or custom apps, you can consume real-time events by using the Apache Kafka protocol.

This article shows you how to add a custom endpoint destination or a custom app destination to an eventstream in Microsoft Fabric event streams.

Note

If you want to use enhanced capabilities that are in preview, select Enhanced capabilities at the top. Otherwise, select Standard capabilities. For information about enhanced capabilities that are in preview, see Introduction to Fabric event streams.

Prerequisites

Before you start, you must get access to a premium workspace with Contributor or higher permissions where your eventstream is located.

Note

The maximum number of sources and destinations for one eventstream is 11.

Add a custom endpoint as a destination

If you want to route event data to your app, you can add a custom endpoint as your eventstream destination:

  1. If you're in the live view, switch to edit mode by selecting Edit on the ribbon.

    Screenshot that shows the Edit button that lets you switch to edit mode.

  2. In edit mode, add a custom endpoint destination in one of the following ways:

    • Select Add destination on the ribbon, select Custom endpoint, and then connect the endpoint to your default stream or derived stream.

      Screenshot that shows the selection of a custom endpoint as a destination on the ribbon.

    • In the editor, select Transform events or add destination, and then select Custom endpoint.

      Screenshot that shows the selection of a custom endpoint in the editor.

  3. For Destination name, enter a name for the custom endpoint. Then select Save.

    Screenshot that shows the pane for entering a name for a custom endpoint.

  4. Connect the default stream tile to the custom endpoint tile if there's no existing connection.

    Screenshot that shows the connection to a custom endpoint tile.

  5. To view the detailed information of your custom endpoint, select Publish.

    Screenshot that shows the Publish button.

Get endpoint details on the Details pane to consume events

In the live view, select the custom endpoint tile. The Details pane that appears has three protocol tabs: Event Hub, AMQP, and Kafka.

Screenshot that shows the Details pane for a custom endpoint.

Each protocol tab has three pages: Basic, Keys, and Sample code. These pages offer the endpoint details with the corresponding protocol for connecting.

Basic shows the name, type, and status of your custom endpoint.

Screenshot that shows basic details for a custom endpoint in the eventstream live view.

Keys provides information about connection keys. Sample code provides the sample code, with the corresponding keys embedded, that you can use to stream the events to your eventstream. The information on these pages varies by protocol.

Event hub

The Keys page on the Event Hub tab contains information related to an event hub's connection string. The information includes Event hub name, Shared access key name, Primary key, and Connection string-primary key.

Screenshot that shows event hub keys on the Details pane of the eventstream live view.

The event hub format is the default for the connection string, and it works with the Azure Event Hubs SDK. This format allows you to connect to your eventstream via the Event Hubs protocol.

The following example shows what the connection string looks like in event hub format:

Endpoint=sb://eventstream-xxxxxxxx.servicebus.windows.net/;SharedAccessKeyName=key_xxxxxxxx;SharedAccessKey=xxxxxxxx;EntityPath=es_xxxxxxx

The Sample code page on the Event Hub tab offers ready-to-use code that includes the required information about connection keys in the event hub. Simply copy and paste it into your application for use.

Screenshot that shows event hub sample code on the Details pane of the eventstream live view.

Kafka

The Kafka format is compatible with the Apache Kafka protocol, which is a popular distributed streaming platform that supports high-throughput and low-latency data processing. You can use the Keys and Sample code information for the Kafka protocol format to connect to the eventstream and consume the events.

Screenshot that shows Kafka keys on the Details pane of the eventstream live view.

The Sample code page on the Kafka tab provides ready-made code, including the necessary connection keys in Kafka format. Simply copy it for your use.

Screenshot that shows Kafka sample code on the Details pane of the eventstream live view.

AMQP

The AMQP format is compatible with the AMQP 1.0 protocol, which is a standard messaging protocol that supports interoperability between various platforms and languages. You can use this format to connect to your eventstream by using the AMQP protocol.

Screenshot that shows AMQP keys on the Details pane of the eventstream live view.

The Sample code page on the AMQP tab provides ready-to-use code with connection key information in AMQP format.

Screenshot that shows AMQP sample code on the Details pane of the eventstream live view.

You can choose the protocol format that suits your application needs and preferences, and then copy and paste the connection string into your application. You can also refer to or copy the sample code on the Sample code page, which shows how to send or receive events by using various protocols.

To learn how to add other destinations to an eventstream, see the following articles:

Prerequisites

Before you start, you must get access to a premium workspace with Contributor or higher permissions where your eventstream is located.

Note

The maximum number of sources and destinations for one eventstream is 11.

Add a custom app as a destination

If you want to route event data to your application, you can add a custom app as your eventstream destination:

  1. Select New destination on the ribbon or the plus sign (+) in the main editor canvas, and then select Custom App.

  2. On the Custom App pane, enter a destination name for the custom app, and then select Add.

    Screenshot of the pane for configuring a custom app as a destination.

Get endpoint details on the Details pane to consume events

After you successfully create the custom application as a destination, you can view the information on the Details pane.

Screenshot that shows the Details pane for a custom app destination.

The Details pane has three protocol tabs: Event Hub, AMQP, and Kafka. Each protocol tab has three pages: Basics, Keys, and Sample code. These pages offer the endpoint details with the corresponding protocol for connecting.

Basic shows the name, type, and status of your custom app.

Screenshot that shows basic details for a custom app on the Details pane of an eventstream.

Keys provides information about connection keys. Sample code provides the sample code, with the corresponding keys embedded, that you can use to stream the events to your eventstream. The information on these pages varies by protocol.

Event hub

The Keys page on the Event Hub tab contains information related to an event hub's connection string. The information includes Event hub name, Shared access key name, Primary key, and Connection string-primary key.

Screenshot that shows event hub keys on the Details pane of the eventstream.

The event hub format is the default for the connection string, and it works with the Azure Event Hubs SDK. This format allows you to connect to your eventstream via the Event Hubs protocol.

The following example shows what the connection string looks like in event hub format:

Endpoint=sb://eventstream-xxxxxxxx.servicebus.windows.net/;SharedAccessKeyName=key_xxxxxxxx;SharedAccessKey=xxxxxxxx;EntityPath=es_xxxxxxx

The Sample code page on the Event Hub tab offers ready-to-use code that includes the required information about connection keys in the event hub. Simply copy and paste it into your application for use.

Screenshot that shows event hub sample code on the Details pane of the eventstream.

Kafka

The Kafka format is compatible with the Apache Kafka protocol, which is a popular distributed streaming platform that supports high-throughput and low-latency data processing. You can use the Keys and Sample code information for the Kafka protocol format to connect to the eventstream and consume the events.

Screenshot that shows Kafka keys on the Details pane of the eventstream.

The Sample code page on the Kafka tab provides ready-made code, including the necessary connection keys in Kafka format. Simply copy it for your use.

Screenshot that shows Kafka sample code on the Details pane of the eventstream.

AMQP

The AMQP format is compatible with the AMQP 1.0 protocol, which is a standard messaging protocol that supports interoperability between various platforms and languages. You can use this format to connect to your eventstream by using the AMQP protocol.

Screenshot that shows AMQP keys on the Details pane of the eventstream.

The Sample code page on the AMQP tab provides ready-to-use code with connection key information in AMQP format.

Screenshot that shows AMQP sample code on the Details pane of the eventstream.

You can choose the protocol format that suits your application needs and preferences, and then copy and paste the connection string into your application. You can also refer to or copy the sample code on the Sample code page, which shows how to send or receive events by using various protocols.

Manage a destination

You can edit (via the Edit command) or remove (via the Remove command) an eventstream destination through either the Data pane or the canvas.

When you select Edit, the edit pane opens on the right side of the main editor. You can modify the configuration as you want, including the event transformation logic through the event processor editor.

Screenshot that shows where to select the modify and delete options for destinations on the canvas.

To learn how to add other destinations to an eventstream, see the following articles: