NatsPublisherServices

Provides publisher services for NATS.

Namespace:
KpokPatagon.Queue.Nats
Type:
Class
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
No
Inherits from:
KpokPatagon.Queue.Nats.ServicesBase
Implements:
KpokPatagon.Queue.IPublisherServices, System.IAsyncDisposable

Constructors

NatsPublisherServices

Initializes an instance of NatsPublisherServices.

Signature:
public Void NatsPublisherServices(logger, options)
Parameters
Name Type Summary
logger ILogger<NatsPublisherServices>
options IOptions<QueueConnectionOptions>

Methods

PublishFanoutAsync

Publishes the message to the fanout.

Signature:
public Task PublishFanoutAsync(fanout, message, headers, serializer, cancellationToken)
Parameters
Name Type Summary
fanout String The name of the fanout.
message Object The message to be published.
headers IDictionary<String, String> A dictionary to be published as headers.
serializer IMessageSerializer A service to serialize the message.
cancellationToken CancellationToken A cancellation token.
Exceptions
Type Summary
QueueServicesException Thrown to report errors while publishing the message.

PublishWorkQueueAsync

Publish the message to the queue.

Signature:
public Task PublishWorkQueueAsync(queue, message, headers, serializer, cancellationToken)
Parameters
Name Type Summary
queue String The name of the queue.
message Object The message to be published.
headers IDictionary<String, String> A dictionary to be published as headers.
serializer IMessageSerializer A service to serialize the message.
cancellationToken CancellationToken A cancellation token.
Exceptions
Type Summary
QueueServicesException Thrown to report errors while publishing the message.