Add a custom endpoint destination to an eventstream

If you want to connect your own application with an eventstream, you can add a custom endpoint (i.e., Custom App in standard capability) destination. Then you can consume real-time events from the eventstream to your own application with the connection endpoint exposed on the custom endpoint (i.e., Custom App in standard capability). Furthermore, with the Apache Kafka protocol available as an option for custom endpoints (i.e., Custom App in standard capability), you can consume real-time events using the Apache Kafka protocol. This article shows you how to add a custom endpoint (i.e., Custom App in standard capability) 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 complete the following prerequisites: 

  • Get access to a premium workspace with Contributor or above 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. Follow these steps to add a custom endpoint destination:

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

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

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

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

      Screenshot that shows the selection of Custom endpoint menu on the ribbon.

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

      Screenshot that shows the selection of Custom endpoint menu in the editor.

  3. Enter a destination name for the custom endpoint, and select Save.

    Screenshot that shows the popup to enter the name for the custom endpoint.

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

    Screenshot that shows the connection to the custom endpoint tile.

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

    Screenshot that shows the selection of the Publish button.

  6. In the live view, select the custom endpoint tile. Then, see the Details pane at the bottom of the page. For more information, see the next section.

    Screenshot that shows the Details pane with three tabs - Event Hubs, AMQP, and Kafka.

Get endpoint details in Details pane to consume events

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

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

[A screenshot showing the basic tab in the Details pane of the eventstream Live view.]

Keys and Sample code pages provide you with the connection keys information and the sample code with the corresponding keys embedded that you can use to stream the events to your eventstream. The Keys and Sample code information varies by protocol.

Event hub

The Keys in the Event hub protocol format contain information related to an event hub connection string, including the Event hub name, Shared access key name, Primary key, and Connection string-primary key. The Event hub format is the default for the connection string and works with 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

[A screenshot showing the Event Hub keys in the Details pane of the eventstream Live view.]

The Sample code page in Event Hubs tab offers ready-to-use code with the required connection keys information in Event hub included. Simply copy and paste it into your application for use.

[A screenshot showing the Event Hub Sample code in 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 in Kafka protocol format to connect to eventstream and consume the events.

[A screenshot showing the Kafka keys in the Details pane of the eventstream Live view.]

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

[A screenshot showing the Kafka Sample code in 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 different platforms and languages. You can use this format to connect to your eventstream using the AMQP protocol.

[A screenshot showing the AMQP keys in the Details pane of the eventstream Live view.]

The Sample code page in AMQP tab also provides you with the ready-to-use code with connection keys information in AMQP format.

[A screenshot showing the AMQP Sample code in the Details pane of the eventstream Live view.]

You can choose the protocol format that suits your application needs and preferences and copy and paste the connection string into your application. You can also refer to or copy the sample code that we provide in the Sample code tab, which shows how to send or receive events using different protocols.

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

Prerequisites

Before you start, you must complete the following prerequisites:

  • Get access to a premium workspace with Contributor or above 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. Follow these steps to add a custom app destination:

  1. Select New destination on the ribbon or "+" in the main editor canvas and then select Custom App. The Custom App destination configuration screen appears.

  2. Enter a destination name for the custom app and select Add.

    Screenshot of the Custom App destination configuration screen.

  3. After you have successfully created the custom application destination, you can switch and view the following information in the Details tab in the lower pane:

    Screenshot showing the custom app destination.

Get endpoint details in Details pane to consume events

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

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

[A screenshot showing the customapp basic tab in the Details pane of the eventstream.]

Keys and Sample code pages provide you with the connection keys information and the sample code with the corresponding keys embedded that you can use to stream the events to your eventstream. The Keys and Sample code information varies by protocol.

Event hub

The Keys in the Event hub protocol format contain information related to an event hub connection string, including the Event hub name, Shared access key name, Primary key, and Connection string-primary key. The Event hub format is the default for the connection string and works with 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

[A screenshot showing the Event Hub keys in the Details pane of the eventstream.]

The Sample code page in Event Hubs tab offers ready-to-use code with the required connection keys information in Event hub included. Simply copy and paste it into your application for use.

[A screenshot showing the Event Hub Sample code in 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 in Kafka protocol format to connect to eventstream and consume the events.

[A screenshot showing the Kafka keys in the Details pane of the eventstream.]

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

[A screenshot showing the Kafka Sample code in 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 different platforms and languages. You can use this format to connect to your eventstream using the AMQP protocol.

[A screenshot showing the AMQP keys in the Details pane of the eventstream.]

The Sample code page in AMQP tab also provides you with the ready-to-use code with connection keys information in AMQP format.

[A screenshot showing the AMQP Sample code in the Details pane of the eventstream.]

You can choose the protocol format that suits your application needs and preferences and copy and paste the connection string into your application. You can also refer to or copy the sample code that we provide in the Sample code tab, which shows how to send or receive events using different protocols.

Manage a destination

Edit/remove: You can edit or remove an eventstream destination either through the navigation pane or canvas.

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

Screenshot showing 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: