Azure Service Bus
The Azure Service Bus is an enterprise message bus, which can also be connected to an ETLBox data flow. This article will give you an overview how to use the connector.
ETLBox.Azure.ServiceBus package
In order to use the Azure Service Bus connector, you need to add the nuget ETLBox.Azure.ServiceBus to your project.
Service Bus Source example
The ServiceBusSource
allows you to read events from a queue or topic. Here is an example snippet:
Service Bus Destination example
Shared Configuration
The ServiceBusSource
and ServiceBusDestination
expose properties that can be used to configure the components:
ConnectionString
: The connection string used to establish the connection to the Azure Service Bus.QueueOrTopicName
: The name of the queue or topic where you want to read from or write into.Client
: TheServiceBusClient
that owns the connection and can be used to create senders and receivers. Automatically created if you provide aConnectionString
, unless you provide your own instance here.ClientOptions
: The client options used when instantiating a new client.
Source only properties
The following properties are only available in the Azure Service Bus Source:
ReceiverOptions
: The receiver options used when instantiating a receiver.SubscriptionName
: Optional: The name of the subscription for a topicMaxMessages
: The maximum number of messages that will be received per requestContinueReceiving
: Function that determines if the next message should be retrieved,based on the last retrieved message. Default is true, so all available messages will be retrieved.MaxWaitTime
: The maximum wait time for the next message. Set this to null if you want to wait indefinitely. If the wait time is has been reached, the Service Bus Source will send the already received messages into the data flow.
Destination only properties
SenderOptions
: The sender options used when instantiating a new sender.MessageCreation
: By default, your object is serialized into json and send as a ServiceBusMessage without additional parameters. Define your own serialization function here.
Dynamic object support
Like all other data flow components, Service bus source and destination support the dynamic ExpandoObject
. Simple use either ServiceBusSource
or ServiceBusSource<ExpandoObject>
instead of ServiceBusSource<T>
.