Skip to content

Latest commit

 

History

History
101 lines (64 loc) · 4.2 KB

Readme.md

File metadata and controls

101 lines (64 loc) · 4.2 KB

MQContract.NATS

Contents

Connection type

Namespace

MQContract.NATS

Summary

This is the MessageServiceConnection implementation for using NATS.io

#ctor(options) constructor

Summary

Primary constructor to create an instance using the supplied configuration options.

Parameters
Name Type Description
options NATS.Client.Core.NatsOpts

DefaultTimeout property

Summary

The default timeout to use for RPC calls when not specified by class or in the call. DEFAULT: 30 seconds

MaxMessageBodySize property

Summary

The maximum message body size allowed. DEFAULT: 1MB

CreateStreamAsync(streamConfig,cancellationToken) method

Summary

Called to define a Stream inside the underlying NATS context. This is an exposure of the NatsJSContext.CreateStreamAsync

Returns

The stream creation result

Parameters
Name Type Description
streamConfig NATS.Client.JetStream.Models.StreamConfig The configuration settings for the stream
cancellationToken System.Threading.CancellationToken A cancellation token

RegisterConsumerConfig(channelName,consumerConfig) method

Summary

Called to register a consumer configuration for a given channel. This is only used for stream channels and allows for configuring storing and reading patterns

Returns

The underlying connection to allow for chaining

Parameters
Name Type Description
channelName System.String The underlying stream name that this configuration applies to
consumerConfig NATS.Client.JetStream.Models.ConsumerConfig The consumer configuration to use for that stream

UnableToConnectException type

Namespace

MQContract.NATS

Summary

Thrown when an error occurs attempting to connect to the NATS server.
Specifically this will be thrown when the Ping that is executed on each initial connection fails.