Table of Contents

Class AzureEventBus

Namespace
Savvyio.Extensions.QueueStorage.EventDriven
Assembly
Savvyio.Extensions.QueueStorage.dll

Provides a combined Azure Event Grid/Azure Storage Queue implementation of the IPublishSubscribeChannel<TRequest>.

public class AzureEventBus : AzureQueue<IIntegrationEvent>, IPublishSubscribeChannel<IIntegrationEvent>, IPublisher<IIntegrationEvent>, ISubscriber<IIntegrationEvent>, IHealthCheckProvider<Uri>
Inheritance
AzureEventBus
Implements
Derived
Inherited Members

Constructors

AzureEventBus(IMarshaller, AzureQueueOptions, AzureEventBusOptions)

Initializes a new instance of the AzureEventBus class.

public AzureEventBus(IMarshaller marshaller, AzureQueueOptions azureQueueOptions, AzureEventBusOptions azureEventBusOptions)

Parameters

marshaller IMarshaller

The IMarshaller to use for serializing and deserializing IIntegrationEvent implementations to messages.

azureQueueOptions AzureQueueOptions

The AzureQueueOptions for configuring AzureQueue<TRequest>.

azureEventBusOptions AzureEventBusOptions

The AzureEventBusOptions used to configure this instance.

Fields

CloudEventTypeExtensionAttribute

The attribute name for the CloudEvent type extension.

public const string CloudEventTypeExtensionAttribute = "typeext"

Field Value

string

Methods

GetHealthCheckTarget()

Gets the Uri representing the health check endpoint for the configured Azure Event Grid topic.

public Uri GetHealthCheckTarget()

Returns

Uri

A Uri instance pointing to the health check endpoint of the Azure Event Grid topic.

PublishAsync(IMessage<IIntegrationEvent>, Action<AsyncOptions>)

Publishes the specified message asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.

public Task PublishAsync(IMessage<IIntegrationEvent> message, Action<AsyncOptions> setup = null)

Parameters

message IMessage<IIntegrationEvent>

The message to publish.

setup Action<AsyncOptions>

The AsyncOptions which may be configured.

Returns

Task

A Task that represents the asynchronous operation.

Exceptions

ArgumentNullException

message cannot be null.

SubscribeAsync(Func<IMessage<IIntegrationEvent>, CancellationToken, Task>, Action<SubscribeAsyncOptions>)

Subscribe to one or more message(s) asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.

public Task SubscribeAsync(Func<IMessage<IIntegrationEvent>, CancellationToken, Task> asyncHandler, Action<SubscribeAsyncOptions> setup = null)

Parameters

asyncHandler Func<IMessage<IIntegrationEvent>, CancellationToken, Task>

The function delegate that will handle received messages.

setup Action<SubscribeAsyncOptions>

The SubscribeAsyncOptions which may be configured.

Returns

Task

A Task that represents the asynchronous operation.

Exceptions

ArgumentNullException

asyncHandler cannot be null.