From this version release notes are kept in each release on GitHub.
- New: Adds
MyNatsClient.Encodings.Protobuf
package which brings support for Protobuf serialization of messages.
- Changed: Multi targeting frameworks:
NETStandard2.0
and.NET4.5.1
forMyNatsClient
andNETStandard2.0
and.NET4.6
forMyNatsClient.Rx
. - Changed:
IFilteredObservable<T>
has been dropped in favour for a pureINatsObsevable<T>
which now uses custom operators for:Where
,Cast
,OfType
, hence it's likeSystem.Reactive
so if you want to use that instead just don't use the extensions inMyNatsClient
. - Changed: When using
Subscribe
against the streams,ObservableOf<T>
does callIObserver<T>.OnError
if a handler causes an exception. When usingSubscribeSafe
it will silently swallow any unhandled exception that your handler might cause. - Changed: Use
NatsObserver.Delegating|Safe
asDelegatingObserver
is not made public anymore. You can easily copy it if you want it or useAnonymousObserver
inSystem.Reactive
. - Changed: Constructor for
NatsClient
no longer acceptsId
as it has no usage. - Changed: All methods in
INatsClient
for subscribing is now calledSub
orSubAsync
. Hence,SubWithObserver(...)
,SubWithHandler(...)
andSubWithObservableSubscription(...)
is nowSub(...)
. AndSubWithObserverAsync(...)
,SubWithHandlerAsync(...)
andSubWithObservableSubscriptionAsync(...)
is nowSubAsync(...)
- Changed: Support for statistics defined by
INatsClientStats
has been dropped and is not accessible viaclient.Stats
anymore. - Changed:
OnException
hook has been removed. - Changed:
ClientConsumerFailed
is nowClientWorkerFailed
. - Changed:
MyNatsClient.Encodings.Json
now usesDefaultContractResolver
andDefaultNamingStrategy
instead ofCamelCase
. If you want the latter, this has to be explicitly configured. - Changed:
MyNatsClient.Encodings.Json* now uses
DateTimeZoneHandling.RoundtripKindinstead of
DateTimeZoneHandling.Utc`. If you want the latter, this has to be explicitly configured. - Changed: Removed all variants of
client.Sub
that accepts anIObserver<T>
orAction<T>
as you as the user of the client should own thestream.Subscribe
call. You will get the stream passed:client.Sub("mysubject", stream => stream.Subscribe(msg => {}))
or e.g.client.Sub("mysubject", stream => stream.SubscribeSafe(myObserver)
. - Fix: Bug with
Unsub
not being performed correctly ifISubscription
was disposed. - New: Constructor for
NatsClient
now accepts an optionalISocketFactory
. - New:
SocketOptions.UseNagleAlgorithm
, defaults to (false). - New: New overloads of
client.Unsub(...)
andclient.UnsubAsync(...)
, which now accepts theISubscription
.
- Fixed: Although it worked as it was, the
RequestAsync
method now uses same patter as other clients, and invokes an automaticunsub
withmaxMessages=1
so that many responders doesn't make the client get unnecessary replies.
- Added: New NuGet
MyNatsClient.Encodings.Json
which ads simpleEncode
andDecode
support for JSON and simplifying extension methods for it. - Fixed: Bug with
PubAsync
variations/overloads that usedIPayload
instead ofbyte[]
orstring
.
Enabling lost support for .NET4.5+, so now .NET4.5+ is build specifically for .NET (plain old .NET) and .NET Core is build against .NET Standard 1.6
- Fixed: Support for .NET4.5 again which was lost in
v0.8.0
where the idea was to support it via .NET Standard.
- Fixed:
NatsException
does not extendAggregateException
anymore, as there seem to be an issue with internal stuff in .NET Core trying to reach members that does not exist. - Fixed:
client.RequestAsync(...)
now usesTaskCompletionSource.SetException
for the time out instead of having the method throw the exception.
Focus of this release has been to offer more hooks for exceptions in your handlers.
- Added:
client.OpStream.OnException = (op, ex) => {}
as a generic client hook for getting notified of exceptions in handlers for the all OPS stream. - Added:
client.MsgOpStream.OnException = (msg, ex) => {}
as a generic client hook for getting notified of exceptions in handlers for the MsgOP stream. - Added: Any exception caused by an observer will now be logged via a
ILogger.Error
resolved viaLoggerManager.Resolve
, which is a place where you can hook in NLog, Serilog or whatever.
Focus has been on stabilizing the experience and we are closing in on getting a stable API. No more planned changes exists.
- Changed:
ConnectionInfo.AutoReconnectOnFailure
is now by defaulttrue
, so in case that the internal consumer of a message fails, it will try and auto reconnect. - Changed: A failing observable subscription does no longer remove the subscription.
OnError
for the observer is still called if you have injected that. You can therefore control if it should be terminated or not. This is done, e.g. so that just becase Msg#1 on a certain subject X doesn't prevent Msg#2 against the same subject to be handled. Before, the handler subscription was removed if there was an exception for the first one. - Changed:
NatsOpMediator
no longer extendsIObservable<>
but instead exposes two observable streams via composition. This is probably nothing you have used though. - Changed:
INatsClient
now exposesINatsConnectionManager
instead of aISocketFactory
. You now assign a customSocketFactory
to the manager instead of to the client.client.ConnectionManager.SocketFactory = new MySocketFactory()
- Changed:
INatsClient.State
is removed, instead there's a simpleclient.IsConnected
to chech instead. - Changed: Some codes in
NatsExceptionCodes
has changed. These are used as value forNatsException.ExceptionCode
. - Changed: When connecting to a NATS Server, the
CONNECT
(handshake) now sendspedantic=false
andprotocol:1
- Changed: No more specific compile for .NET4.5 as .NET4.5 is supported via .NET Standard 1.6.
- Changed: Made
NatsClient.Stats.OpCount
aulong
instead oflong
. - Changed:
ConnectionInfo.SocketOptions.SendTimeOut
now defaults to10s
. Before it had no timeout. - Changed: Tweaked settings for
ConnectionInfo.SocketOptions.ReceiveTimeoutMs
to be5s
instead of10s
. - Added: New setting
ConnectionInfo.SocketOptions.ConnectTimeoutMs
with default of5s
. So no more long defaults on Windows. - Added: New setting
ConnectionInfo.RequestTimeoutMs
with default of5s
. That is what will be used if no specific request timeout is passed toclient.RequestAsync
. - Added: Since we now send
protocol:1
in theCONNECT
, we now get additive information dispatched to the client via whenever a new server is added to the cluster. In the next release that will be used to keep a hot list with the possible servers/hosts for a client to connect to in a cluster. Meaning that you will be able to connect to a seed server. - Added:
NatsServerInfo.Host
,NatsServerInfo.Port
is now extracted from the info sent from the server. - Fixed: Issue with missed
ConfigureAwait(false)
. - Fixed: Issue with looking at wrong state flag (which now has been removed) while disconnecting.
- Fixed: Potential issue with not cleaning some resources when trying to connect to multiple servers where e.g. #1 failed and #2 succeeded.
Theme for this release has been "SIMPLIFY".
- New: All subscribe methods on the client now remembers subscriptions. So, if the client disconnects and reconnects, the subscriptions will get re-subscribed against the NATS server.
- New: All subscribe methods now returns an
ISubscription
which can be (not necessary) used to unsub, just by callingsubscription.Dispose()
or by callingclient.Unsub(subscription.SubscriptionInfo)
. - New: Setup subscription to both NATS-server and in-process
IObservable<MsgOp>
stream in a single call using:client.SubscribeWithHandler|SubscribeWithHandlerAsync
orclient.SubscribeWithObserver|SubscribeWithObserverAsync
. - New:
client.RequestAsync
assists with implementing request-response messaging pattern. - Removed:
NatsConsumer
as those features now are exposed by theNatsClient
instead. - Removed: Some overloads of
client.Sub
andclient.Unsub
. - Fixed: Issue with not being able to do:
client.Connect()
,client.Disconnect()
andclient.Connect()
really fast. - Fixed: Issue with always trying to do auto reconnect upon failure.
- Fixed: Issue with missed
ConfigureAwait(false)
.
- New:
ConnectionInfo.AutoReconnectOnFailure=true|false
default isfalse
. Will try and reconnect if the client fails. If no reconnect can be made, anClientAutoReconnectFailed
will be dispatched.
- Fixed:
NatsConsumer.Subscribe()
now supports wildcard"*"
and full wildcard">"
.
- New:
NatsConsumer.Subscribe()
now also accepts a handler with definitionAction<MsgOp>
and not only anIObserver<MsgOp>
. - New: The overloads of
NatsClient.Sub|SubAsync
that takes aSubscriptionInfo
now makes an automatical call toUnSub|UnSubAsync
if themaxMessages
option has been specified.
- New: Introducing
NatsConsumer
for simplified experience around message consumption. See README for more info. - Changed:
client.UnSub
is nowclient.Unsub
andclient.UnSubAsync
is nowclient.Unsubasync
.
- New: Support for DotNet Core.
- New: You can now have credentials on a specific host instead of common credentials. Specific overrides common.
- Fixed:
client.Pub
methods hadreplyTo
as mandatory argument but it is optional.
- Closed: #7, remove dependency on JSON.Net
- Closed: #10, provide MyNatsClient.Rx as a convenience NuGet for bringing in MyNatsClient and Rx.
- Fixed: #9, with mix up of QueueGroup and ReplyTo
- Fixed: Wrong dependencies in NuSpec
First release.