Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SbClientOptions

Options for SbClient

Sharing resources with SgServer:

When both SgServer and SgClient 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 and SgClient:

  • Make sure that the identifiers SbServerOptions.name & SgClientOptions.name are identical.
  • Make sure 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.

Hierarchy

  • SbClientOptions

Index

Properties

Optional client

client: SbConnectionOptions<SbCredentials, ServiceBusClientOptions>

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.

Optional logger

logger: LoggerService

Optional management

management: SbManagementClientOptions[keyof SbManagementClientOptions]

Optional name

name: string

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:

  • All servers & clients are shared (unless a client is specified explicitly)
  • All emitters will use the default client (unless an emitter specify a client reference 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