Class AmazonEventBus
- Namespace
- Savvyio.Extensions.SimpleQueueService.EventDriven
- Assembly
- Savvyio.Extensions.SimpleQueueService.dll
Provides a default implementation of the AmazonBus<TRequest> class tailored for messages holding an IIntegrationEvent implementation.
public class AmazonEventBus : AmazonBus<IIntegrationEvent>, IConfigurable<AmazonMessageOptions>, IPublishSubscribeChannel<IIntegrationEvent>, IPublisher<IIntegrationEvent>, ISubscriber<IIntegrationEvent>, IHealthCheckProvider<IAmazonSimpleNotificationService>
- Inheritance
-
AmazonEventBus
- Implements
- Derived
- Inherited Members
Constructors
AmazonEventBus(IMarshaller, AmazonEventBusOptions)
Initializes a new instance of the AmazonEventBus class.
public AmazonEventBus(IMarshaller marshaller, AmazonEventBusOptions options)
Parameters
marshallerIMarshallerThe IMarshaller that is used when converting IIntegrationEvent implementations to messages.
optionsAmazonEventBusOptionsThe AmazonEventBusOptions used to configure this instance.
Exceptions
- ArgumentNullException
marshallercannot be null - or -optionscannot be null.- ArgumentException
optionsare not in a valid state.
Methods
GetHealthCheckTarget()
Returns a new IAmazonSimpleNotificationService client instance configured for health probing of the underlying Amazon SNS service.
public IAmazonSimpleNotificationService GetHealthCheckTarget()
Returns
- IAmazonSimpleNotificationService
An IAmazonSimpleNotificationService client instance used to probe the health status of the notification service.
PublishAsync(IMessage<IIntegrationEvent>, Action<AsyncOptions>)
Publishes the specified event asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.
public override Task PublishAsync(IMessage<IIntegrationEvent> @event, Action<AsyncOptions> setup = null)
Parameters
eventIMessage<IIntegrationEvent>The event to publish.
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
SubscribeAsync(Func<IMessage<IIntegrationEvent>, CancellationToken, Task>, Action<SubscribeAsyncOptions>)
Subscribe to one or more message(s) asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.
public override Task SubscribeAsync(Func<IMessage<IIntegrationEvent>, CancellationToken, Task> asyncHandler, Action<SubscribeAsyncOptions> setup = null)
Parameters
asyncHandlerFunc<IMessage<IIntegrationEvent>, CancellationToken, Task>The function delegate that will handle the message.
setupAction<SubscribeAsyncOptions>The SubscribeAsyncOptions which may be configured.