Client information used to authenticate, authorize & connect with service bus.
The information might be optional if the client is shared with an active SgServer
instance.
In that case, resources are shared between the two.
See SbClientOptions.name
for more information.
A unique name given to this client which allow referencing a specific client to be used by an emitter. In addition, the name is used to pair server & client together to allow sharing of resources (connections/senders/receivers).
By default the name is undefined, which is the identifier for the default client. In most cases a multi-client environment is not required and you will not use the name, this means that:
client
is specified explicitly)Note that the name most be unique across all running instances (runtime scoped, not NestJS application scope) This means that only one default (empty name) server is allowed. If a duplicate name is detected the process will throw.
Generated using TypeDoc
Options for
SbClient
Sharing resources with
SgServer
:When both
SgServer
andSgClient
are used you can link the two together to allow sharing of resources. This will allow sharing the connection, including credentials for both underlying client & managements connections.To link
SgServer
andSgClient
:SbServerOptions.name
&SgClientOptions.name
are identical.SgClientOptions.client
is not set.By default, both identifiers are not set which means that the link is activated unless
SgClientOptions.client
is set.Note that this apply to
SgClientOptions.management
as well.If you wonder why we need to pair via id, see https://github.com/nestjs/nest/issues/4410#issuecomment-603685569. Basically, injection is now available in a microservice
Server
so we can't share resources in a transparent way.