Skip to main content

Class: AzureEventHubTransport

Defined in: livelink.clients/livelink.agent/sources/data/transports/AzureEventHubTransport.ts:66

Transport that subscribes to an Azure Event Hub, under the "azure-event-hub" kind.

Any publisher speaking the Event Hubs protocol works, including Microsoft Fabric "Real-Time Intelligence" Eventstreams via their Event Hubs-compatible custom endpoint.

Channel caveat. Event Hubs has no per-message routing key, so events are emitted on their partition id — a load-balancing artifact, not a topic: the same logical device can land on different partitions, and the assignment can change. Never write a mapping that selects on channel against this transport; select on the payload with when instead. The partition id, offset and sequence number are all available in the event's metadata for diagnostics.

Requires the optional dependency @azure/event-hubs (loaded lazily on AzureEventHubTransport.start).

This transport reads from the latest position and does NOT checkpoint. A production deployment that must not miss events across restarts should extend it with a CheckpointStore (e.g. @azure/eventhubs-checkpointstore-blob) and start from the stored offsets — the sequence_number / offset carried in each event's metadata are what such a store records.

Implements

Constructors

Constructor

new AzureEventHubTransport(config: {
connection_string: string;
consumer_group?: string;
event_hub_name?: string;
}, sink: EventSink): AzureEventHubTransport;

Defined in: livelink.clients/livelink.agent/sources/data/transports/AzureEventHubTransport.ts:90

Parameters

ParameterTypeDescription
config{ connection_string: string; consumer_group?: string; event_hub_name?: string; }-
config.connection_stringstringAzure Event Hubs connection string. Publishers that expose an Event Hubs-compatible endpoint (e.g. a Microsoft Fabric Eventstream "custom endpoint") provide one too; it usually embeds an EntityPath= segment, e.g.: Endpoint=sb://xxxx.servicebus.windows.net/;SharedAccessKeyName=key_xxxx;SharedAccessKey=xxxx;EntityPath=xxxx
config.consumer_group?stringConsumer group to read with. Defaults to the Event Hubs default consumer group ("$Default").
config.event_hub_name?stringEvent hub (entity) name. Only needed when the connection string does NOT embed EntityPath=.
sinkEventSink-

Returns

AzureEventHubTransport

Methods

start()

start(): Promise<void>;

Defined in: livelink.clients/livelink.agent/sources/data/transports/AzureEventHubTransport.ts:98

Connect to the event hub and start receiving events.

Returns

Promise<void>

Implementation of

Transport.start


stop()

stop(): Promise<void>;

Defined in: livelink.clients/livelink.agent/sources/data/transports/AzureEventHubTransport.ts:153

Stop receiving events and close the connection.

Returns

Promise<void>

Implementation of

Transport.stop