Provides publisher services for NATS.
Initializes an instance of NatsPublisherServices.
public Void NatsPublisherServices(logger, options)| Name | Type | Summary |
|---|---|---|
| logger | ILogger<NatsPublisherServices> | |
| options | IOptions<QueueConnectionOptions> |
Publishes the message to the fanout.
public Task PublishFanoutAsync(fanout, message, headers, serializer, cancellationToken)| 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. |
| Type | Summary |
|---|---|
| QueueServicesException | Thrown to report errors while publishing the message. |
Publish the message to the queue.
public Task PublishWorkQueueAsync(queue, message, headers, serializer, cancellationToken)| 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. |
| Type | Summary |
|---|---|
| QueueServicesException | Thrown to report errors while publishing the message. |
In this document