# library_mappings

go_import_path: github.com/google/go-tpm/legacy/tpm2
go_library_name: github.com/google/go-tpm/legacy/tpm2
dotnet_package: Tpm2Lib (Microsoft NuGet)
dotnet_namespace: Tpm2Lib
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:16:31
dotnet_usage_notes:
TPM 2.0 access via Microsoft TSS.MSR. Alternatively use System.Security.Cryptography with TPM providers.


go_import_path: github.com/minio/highwayhash
go_library_name: github.com/minio/highwayhash
dotnet_package: Custom
dotnet_namespace: ZB.MOM.NatsNet.Server.Internal.Hashing
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:16:33
dotnet_usage_notes:
HighwayHash for message integrity. No maintained NuGet. Port algorithm or use SipHash as alternative.


go_import_path: github.com/nats-io/jwt/v2
go_library_name: github.com/nats-io/jwt/v2
dotnet_package: Custom
dotnet_namespace: ZB.MOM.NatsNet.Server.Auth.Jwt
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:16:43
dotnet_usage_notes:
NATS JWT v2 claims library. Custom implementation matching NATS JWT spec. Use System.IdentityModel.Tokens.Jwt for JWT primitives.


go_import_path: github.com/nats-io/nats-server/v2/server/certstore
go_library_name: github.com/nats-io/nats-server/v2/server/certstore
dotnet_package: Custom (ported)
dotnet_namespace: ZB.MOM.NatsNet.Server.CertStore
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:16:59
dotnet_usage_notes:
Certificate store. Internal module being ported. Uses System.Security.Cryptography.X509Certificates.


go_import_path: github.com/nats-io/nkeys
go_library_name: github.com/nats-io/nkeys
dotnet_package: Custom
dotnet_namespace: ZB.MOM.NatsNet.Server.Auth.NKeys
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:17:22
dotnet_usage_notes:
NATS NKeys (Ed25519 key pairs). Custom implementation using System.Security.Cryptography Ed25519 (.NET 9+).


go_import_path: golang.org/x/crypto/bcrypt
go_library_name: golang.org/x/crypto/bcrypt
dotnet_package: BCrypt.Net-Next
dotnet_namespace: BCrypt.Net
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:17:23
dotnet_usage_notes:
bcrypt password hashing. BCrypt.Net-Next NuGet is well-maintained. Alternative: Rfc2898DeriveBytes (PBKDF2).


go_import_path: golang.org/x/sys/windows/svc
go_library_name: golang.org/x/sys/windows/svc
dotnet_package: System.ServiceProcess
dotnet_namespace: System.ServiceProcess
status: mapped
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:17:28
dotnet_usage_notes:
Windows service management. Use Microsoft.Extensions.Hosting.WindowsServices for .NET worker service.


# features

name: AccessTime
go_file: server/ats/ats.go
go_method: AccessTime
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: AccessTimeService
dotnet_method: AccessTime
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
Will load the access time from an atomic.
If no one has registered this will return 0 or stale data.
It is the responsibility of the user to properly register and unregister.


name: SequenceSet.SetInitialMin
go_file: server/avl/seqset.go
go_class: SequenceSet
go_method: SetInitialMin
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: SetInitialMin
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
SetInitialMin should be used to set the initial minimum sequence when known.
This will more effectively utilize space versus self selecting.
The set should be empty.


name: SequenceSet.Delete
go_file: server/avl/seqset.go
go_class: SequenceSet
go_method: Delete
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: Delete
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
Delete will remove the sequence from the set.
Will optionally remove nodes and rebalance.
Returns where the sequence was set.


name: SequenceSet.Range
go_file: server/avl/seqset.go
go_class: SequenceSet
go_method: Range
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: Range
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
Range will invoke the given function for each item in the set.
They will range over the set in ascending order.
If the callback returns false we terminate the iteration.


name: SequenceSet.insertNode
go_file: server/avl/seqset.go
go_class: SequenceSet
go_method: insertNode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: InsertNode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
insertNode places a decoded node into the tree.
These should be done in tree order as defined by Encode()
This allows us to not have to calculate height or do rebalancing.
So much better performance this way.


name: node.clear
go_file: server/avl/seqset.go
go_class: node
go_method: clear
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: Clear
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
Clear the proper bit.
seq should have already been qualified and deleted should be non nil.
Will return true if this node is now empty.


name: node.insertNodePrev
go_file: server/avl/seqset.go
go_class: node
go_method: insertNodePrev
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: InsertNodePrev
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
Will insert nn into the node assuming it is less than all other nodes in n.
Will re-calculate height and balance.


name: node.iter
go_file: server/avl/seqset.go
go_class: node
go_method: iter
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SequenceSet
dotnet_method: Iter
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:28
description:
iter will iterate through the set's items in this node.
If the supplied function returns false we terminate the iteration.


name: GetSubjectDNForm
go_file: server/certidp/certidp.go
go_method: GetSubjectDNForm
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateIdentityProvider
dotnet_method: GetSubjectDNForm
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:29
description:
GetSubjectDNForm returns RDN sequence concatenation of the certificate's subject to be
used in logs, events, etc. Should never be used for reliable cache matching or other crypto purposes.


name: GetIssuerDNForm
go_file: server/certidp/certidp.go
go_method: GetIssuerDNForm
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateIdentityProvider
dotnet_method: GetIssuerDNForm
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:29
description:
GetIssuerDNForm returns RDN sequence concatenation of the certificate's issuer to be
used in logs, events, etc. Should never be used for reliable cache matching or other crypto purposes.


name: CertOCSPEligible
go_file: server/certidp/certidp.go
go_method: CertOCSPEligible
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateIdentityProvider
dotnet_method: CertOCSPEligible
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:29
description:
CertOCSPEligible checks if the certificate's issuer has populated AIA with OCSP responder endpoint(s)
and is thus eligible for OCSP validation


name: OCSPResponseCurrent
go_file: server/certidp/certidp.go
go_method: OCSPResponseCurrent
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateIdentityProvider
dotnet_method: OCSPResponseCurrent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:29
description:
OCSPResponseCurrent checks if the OCSP response is current (i.e. not expired and not future effective)


name: ValidDelegationCheck
go_file: server/certidp/certidp.go
go_method: ValidDelegationCheck
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateIdentityProvider
dotnet_method: ValidDelegationCheck
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:29
description:
ValidDelegationCheck checks if the CA OCSP Response was signed by a valid CA Issuer delegate as per (RFC 6960, section 4.2.2.2)
If a valid delegate or direct-signed by CA Issuer, true returned.


name: encodeOCSPRequest
go_file: server/certidp/ocsp_responder.go
go_method: encodeOCSPRequest
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: OcspResponder
dotnet_method: EncodeOCSPRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:29
description:
encodeOCSPRequest encodes the OCSP request in base64 and URL-encodes it.
This is needed to fulfill the OCSP responder's requirements for the request format. (X.690)


name: createCACertsPool
go_file: server/certstore/certstore_windows.go
go_method: createCACertsPool
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CreateCACertsPool
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
createCACertsPool generates a CertPool from the Windows certificate store,
adding all matching certificates from the caCertsMatch array to the pool.
All matching certificates (vs first) are added to the pool based on a user
request. If no certificates are found an error is returned.


name: TLSConfig
go_file: server/certstore/certstore_windows.go
go_method: TLSConfig
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: TLSConfig
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
TLSConfig fulfills the same function as reading cert and key pair from
pem files but sources the Windows certificate store instead. The
certMatchBy and certMatch fields search the "MY" certificate location
for the first certificate that matches the certMatch field. The
caCertsMatch field is used to search the Trusted Root, Third Party Root,
and Intermediate Certificate Authority locations for certificates with
Subjects matching the provided strings. If a match is found, the
certificate is added to the pool that is used to verify the certificate
chain.


name: winFindCert
go_file: server/certstore/certstore_windows.go
go_method: winFindCert
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: WinFindCert
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
winFindCert wraps the CertFindCertificateInStore library call. Note that any cert context passed
into prev will be freed. If no certificate was found, nil will be returned.


name: winVerifyCertValid
go_file: server/certstore/certstore_windows.go
go_method: winVerifyCertValid
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: WinVerifyCertValid
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
winVerifyCertValid wraps the CertVerifyTimeValidity and simply returns true if the certificate is valid


name: winCertStore.certByIssuer
go_file: server/certstore/certstore_windows.go
go_class: winCertStore
go_method: certByIssuer
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CertByIssuer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
certByIssuer matches and returns the first certificate found by passed issuer.
CertContext pointer returned allows subsequent key operations like Sign. Caller specifies
current user's personal certs or local machine's personal certs using storeType.
See CERT_FIND_ISSUER_STR description at https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certfindcertificateinstore


name: winCertStore.certBySubject
go_file: server/certstore/certstore_windows.go
go_class: winCertStore
go_method: certBySubject
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CertBySubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
certBySubject matches and returns the first certificate found by passed subject field.
CertContext pointer returned allows subsequent key operations like Sign. Caller specifies
current user's personal certs or local machine's personal certs using storeType.
See CERT_FIND_SUBJECT_STR description at https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certfindcertificateinstore


name: winCertStore.certByThumbprint
go_file: server/certstore/certstore_windows.go
go_class: winCertStore
go_method: certByThumbprint
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CertByThumbprint
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
certByThumbprint matches and returns the first certificate found by passed SHA1 thumbprint.
CertContext pointer returned allows subsequent key operations like Sign. Caller specifies
current user's personal certs or local machine's personal certs using storeType.
See CERT_FIND_SUBJECT_STR description at https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certfindcertificateinstore


name: winCertStore.caCertsBySubjectMatch
go_file: server/certstore/certstore_windows.go
go_class: winCertStore
go_method: caCertsBySubjectMatch
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CaCertsBySubjectMatch
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
caCertsBySubjectMatch matches and returns all matching certificates of the subject field.

The following locations are searched:
1) Root (Trusted Root Certification Authorities)
2) AuthRoot (Third-Party Root Certification Authorities)
3) CA (Intermediate Certification Authorities)

Caller specifies current user's personal certs or local machine's personal certs using storeType.
See CERT_FIND_SUBJECT_STR description at https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certfindcertificateinstore


name: winCertStore.certSearch
go_file: server/certstore/certstore_windows.go
go_class: winCertStore
go_method: certSearch
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CertSearch
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
certSearch is a helper function to lookup certificates based on search type and match value.
store is used to specify which store to perform the lookup in (system or user).


name: winCertStore.certKey
go_file: server/certstore/certstore_windows.go
go_class: winCertStore
go_method: certKey
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CertificateStore
dotnet_method: CertKey
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:30
description:
certKey wraps CryptAcquireCertificatePrivateKey. It obtains the CNG private
key of a known certificate and returns a pointer to a winKey which implements
both crypto.Signer. When a nil cert context is passed
a nil key is intentionally returned, to model the expected behavior of a
non-existent cert having no private key.
https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecertificateprivatekey


name: .Match
go_file: server/gsl/gsl.go
go_method: Match
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GenericSubjectList
dotnet_method: Match
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:31
description:
Match will match all entries to the literal subject.
It will return a set of results for both normal and queue subscribers.


name: .MatchBytes
go_file: server/gsl/gsl.go
go_method: MatchBytes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GenericSubjectList
dotnet_method: MatchBytes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:31
description:
MatchBytes will match all entries to the literal subject.
It will return a set of results for both normal and queue subscribers.


name: .HasInterest
go_file: server/gsl/gsl.go
go_method: HasInterest
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GenericSubjectList
dotnet_method: HasInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:31
description:
HasInterest will return whether or not there is any interest in the subject.
In cases where more detail is not required, this may be faster than Match.


name: .NumInterest
go_file: server/gsl/gsl.go
go_method: NumInterest
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GenericSubjectList
dotnet_method: NumInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:31
description:
NumInterest will return the number of subs interested in the subject.
In cases where more detail is not required, this may be faster than Match.


name: ProcUsage
go_file: server/pse/pse_darwin.go
go_method: ProcUsage
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ProcessStatsProvider
dotnet_method: ProcUsageDarwin
notes: Platform-specific Go process stats. .NET uses System.Diagnostics.Process cross-platform.
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
ProcUsage returns CPU and memory usage.
Note upper layers do not use virtual memory size, so ok that it is not filled in here.


name: ProcUsage
description: ProcUsage returns CPU usage
go_file: server/pse/pse_dragonfly.go
go_method: ProcUsage
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ProcessStatsProvider
dotnet_method: ProcUsage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
notes:
Go-specific platform code for unsupported OS. .NET uses cross-platform System.Diagnostics.Process and System.IO.DriveInfo.


name: pdhGetFormattedCounterArrayDouble
go_file: server/pse/pse_windows.go
go_method: pdhGetFormattedCounterArrayDouble
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ProcessStatsProvider
dotnet_method: PdhGetFormattedCounterArrayDouble
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
pdhGetFormattedCounterArrayDouble returns the value of return code
rather than error, to easily check return codes


name: getProcessImageName
go_file: server/pse/pse_windows.go
go_method: getProcessImageName
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ProcessStatsProvider
dotnet_method: GetProcessImageName
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
getProcessImageName returns the name of the process image, as expected by
the performance counter API.


name: Account.shallowCopy
go_file: server/accounts.go
go_class: Account
go_method: shallowCopy
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: ShallowCopy
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used to create shallow copies of accounts for transfer
from opts to real accounts in server struct.
Account `na` write lock is expected to be held on entry
while account `a` is the one from the Options struct
being loaded/reloaded and do not need locking.


name: Account.getExternalClientsLocked
go_file: server/accounts.go
go_class: Account
go_method: getExternalClientsLocked
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: GetExternalClientsLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns a slice of external (non-internal) clients stored in the account, or nil if none is present.
Lock is held on entry.


name: Account.expectedRemoteResponses
go_file: server/accounts.go
go_class: Account
go_method: expectedRemoteResponses
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: ExpectedRemoteResponses
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
When querying for subject interest this is the number of
expected responses. We need to actually check that the entry
has active connections.


name: Account.MaxActiveConnections
go_file: server/accounts.go
go_class: Account
go_method: MaxActiveConnections
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: MaxActiveConnections
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
MaxActiveConnections return the set limit for the account system
wide for total number of active connections.


name: Account.MaxActiveLeafNodes
go_file: server/accounts.go
go_class: Account
go_method: MaxActiveLeafNodes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: MaxActiveLeafNodes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
MaxActiveLeafNodes return the set limit for the account system
wide for total number of leavenode connections.
NOTE: these are tracked separately.


name: Account.RoutedSubs
go_file: server/accounts.go
go_class: Account
go_method: RoutedSubs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: RoutedSubs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
RoutedSubs returns how many subjects we would send across a route when first
connected or expressing interest. Local client subs.


name: Account.AddMapping
go_file: server/accounts.go
go_class: Account
go_method: AddMapping
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddMapping
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
AddMapping adds in a simple route mapping from src subject to dest subject
for inbound client messages.


name: Account.selectMappedSubject
go_file: server/accounts.go
go_class: Account
go_method: selectMappedSubject
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SelectMappedSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This performs the logic to map to a new dest subject based on mappings.
Should only be called from processInboundClientMsg or service import processing.


name: Account.SubscriptionInterest
go_file: server/accounts.go
go_class: Account
go_method: SubscriptionInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SubscriptionInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
SubscriptionInterest returns true if this account has a matching subscription
for the given `subject`.


name: Account.addClient
go_file: server/accounts.go
go_class: Account
go_method: addClient
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddClient
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
addClient keeps our accounting of local active clients or leafnodes updated.
Returns previous total.


name: Account.removeLeafNode
go_file: server/accounts.go
go_class: Account
go_method: removeLeafNode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: RemoveLeafNode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper function to remove leaf nodes. If number of leafnodes gets large
this may need to be optimized out of linear search but believe number
of active leafnodes per account scope to be small and therefore cache friendly.
Lock should not be held on general account lock.


name: Account.TrackServiceExport
go_file: server/accounts.go
go_class: Account
go_method: TrackServiceExport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: TrackServiceExport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
TrackServiceExport will enable latency tracking of the named service.
Results will be published in this account to the given results subject.


name: Account.TrackServiceExportWithSampling
go_file: server/accounts.go
go_class: Account
go_method: TrackServiceExportWithSampling
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: TrackServiceExportWithSampling
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
TrackServiceExportWithSampling will enable latency tracking of the named service for the given
sampling rate (1-100). Results will be published in this account to the given results subject.


name: Account.IsExportServiceTracking
go_file: server/accounts.go
go_class: Account
go_method: IsExportServiceTracking
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: IsExportServiceTracking
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
IsExportServiceTracking will indicate if given publish subject is an export service with tracking enabled.


name: ServiceLatency.merge
go_file: server/accounts.go
go_class: ServiceLatency
go_method: merge
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServiceLatency
dotnet_method: Merge
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Merge function to merge m1 and m2 (requestor and responder) measurements
when there are two samples. This happens when the requestor and responder
are on different servers.

m2 ServiceLatency is correct, so use that.
m1 TotalLatency is correct, so use that.
Will use those to back into NATS latency.


name: sanitizeLatencyMetric
go_file: server/accounts.go
go_method: sanitizeLatencyMetric
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SanitizeLatencyMetric
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
sanitizeLatencyMetric adjusts latency metric values that could go
negative in some edge conditions since we estimate client RTT
for both requestor and responder.
These numbers are never meant to be negative, it just could be
how we back into the values based on estimated RTT.


name: Account.sendReplyInterestLostTrackLatency
go_file: server/accounts.go
go_class: Account
go_method: sendReplyInterestLostTrackLatency
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SendReplyInterestLostTrackLatency
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used to send a latency result when the requestor interest was lost before the
response could be delivered.


name: Account.sendTrackingLatency
go_file: server/accounts.go
go_class: Account
go_method: sendTrackingLatency
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SendTrackingLatency
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
sendTrackingLatency will send out the appropriate tracking information for the
service request/response latency. This is called when the requestor's server has
received the response.
TODO(dlc) - holding locks for RTTs may be too much long term. Should revisit.


name: updateAllClientsServiceExportResponseTime
go_file: server/accounts.go
go_method: updateAllClientsServiceExportResponseTime
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: UpdateAllClientsServiceExportResponseTime
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will check to make sure our response lower threshold is set
properly in any clients doing rrTracking.


name: Account.addServiceImportWithClaim
go_file: server/accounts.go
go_class: Account
go_method: addServiceImportWithClaim
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddServiceImportWithClaimInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
addServiceImportWithClaim will add in the service import via the jwt claim.
It will also skip the authorization check in cases where internal is true


name: Account.SetServiceImportSharing
go_file: server/accounts.go
go_class: Account
go_method: SetServiceImportSharing
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SetServiceImportSharing
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
SetServiceImportSharing will allow sharing of information about requests with the export account.
Used for service latency tracking at the moment.


name: Account.AddServiceImport
go_file: server/accounts.go
go_class: Account
go_method: AddServiceImport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddServiceImport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
AddServiceImport will add a route to an account to send published messages / requests
to the destination account. From is the local subject to map, To is the
subject that will appear on the destination account. Destination will need
to have an import rule to allow access via addService.


name: Account.NumPendingReverseResponses
go_file: server/accounts.go
go_class: Account
go_method: NumPendingReverseResponses
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: NumPendingReverseResponses
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
NumPendingReverseResponses returns the number of response mappings we have for all outstanding
requests for service imports.


name: Account.NumPendingResponses
go_file: server/accounts.go
go_class: Account
go_method: NumPendingResponses
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: NumPendingResponses
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
NumPendingResponses returns the number of responses outstanding for service exports
on this account. An empty filter string returns all responses regardless of which export.
If you specify the filter we will only return ones that are for that export.
NOTE this is only for what this server is tracking.


name: Account.removeRespServiceImport
go_file: server/accounts.go
go_class: Account
go_method: removeRespServiceImport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: RemoveRespServiceImport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
removeRespServiceImport removes a response si mapping and the reverse entries for interest detection.


name: Account.checkForReverseEntries
go_file: server/accounts.go
go_class: Account
go_method: checkForReverseEntries
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckForReverseEntries
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
checkForReverseEntries is for when we are trying to match reverse entries to a wildcard.
This will be called from checkForReverseEntry when the reply arg is a wildcard subject.
This will usually be called in a go routine since we need to walk all the entries.


name: Account.checkForReverseEntry
go_file: server/accounts.go
go_class: Account
go_method: checkForReverseEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckForReverseEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This checks for any response map entries. If you specify an si we will only match and
clean up for that one, otherwise we remove them all.


name: Account._checkForReverseEntry
go_file: server/accounts.go
go_class: Account
go_method: _checkForReverseEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckForReverseEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Callers should use checkForReverseEntry instead. This function exists to help prevent
infinite recursion.


name: Account.addServiceImport
go_file: server/accounts.go
go_class: Account
go_method: addServiceImport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddServiceImportInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Add a service import.
This does no checks and should only be called by the msg processing code.
Use AddServiceImport from above if responding to user input or config changes, etc.


name: Account.createRespWildcard
go_file: server/accounts.go
go_class: Account
go_method: createRespWildcard
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CreateRespWildcard
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will create the response prefix for fast generation of responses.
A wildcard subscription may be used handle interest graph propagation
for all service replies, unless we are bound to a leafnode.
Lock should be held.


name: Account.newServiceReply
go_file: server/accounts.go
go_class: Account
go_method: newServiceReply
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: NewServiceReply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Generate a new service reply from the wildcard prefix.
FIXME(dlc) - probably do not have to use rand here. about 25ns per.


name: Account.SetServiceExportResponseThreshold
go_file: server/accounts.go
go_class: Account
go_method: SetServiceExportResponseThreshold
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: SetServiceExportResponseThreshold
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
SetServiceExportResponseThreshold sets the maximum time the system will a response to be delivered
from a service export responder.


name: Account.AddMappedStreamImportWithClaim
go_file: server/accounts.go
go_class: Account
go_method: AddMappedStreamImportWithClaim
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddMappedStreamImportWithClaim
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
AddMappedStreamImportWithClaim will add in the stream import from a specific account with optional token.


name: Account.AddStreamExport
go_file: server/accounts.go
go_class: Account
go_method: AddStreamExport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddStreamExport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
AddStreamExport will add an export to the account. If accounts is nil
it will signify a public export, meaning anyone can import.


name: Account.addStreamExportWithAccountPos
go_file: server/accounts.go
go_class: Account
go_method: addStreamExportWithAccountPos
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: AddStreamExportWithAccountPos
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
AddStreamExport will add an export to the account. If accounts is nil
it will signify a public export, meaning anyone can import.
if accountPos is > 0, all imports will be granted where the following holds:
strings.Split(subject, tsep)[accountPos] == account id will be granted.


name: Account.getWildcardServiceExport
go_file: server/accounts.go
go_class: Account
go_method: getWildcardServiceExport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: GetWildcardServiceExport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This helper is used when trying to match a serviceExport record that is
represented by a wildcard.
Lock should be held on entry.


name: Account.activationExpired
go_file: server/accounts.go
go_class: Account
go_method: activationExpired
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: ActivationExpired
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Fires for expired activation tokens. We could track this with timers etc.
Instead we just re-analyze where we are and if we need to act.


name: Account.checkActivation
go_file: server/accounts.go
go_class: Account
go_method: checkActivation
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckActivation
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
checkActivation will check the activation token for validity.
ea may only be nil in cases where revocation may not be checked, say triggered by expiration timer.


name: Account.isIssuerClaimTrusted
go_file: server/accounts.go
go_class: Account
go_method: isIssuerClaimTrusted
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: IsIssuerClaimTrusted
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if the activation claim is trusted. That is the issuer matches
the account or is an entry in the signing keys.


name: Account.checkStreamImportsEqual
go_file: server/accounts.go
go_class: Account
go_method: checkStreamImportsEqual
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckStreamImportsEqual
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if `a` and `b` stream imports are the same. Note that the
check is done with the account's name, not the pointer. This is used
during config reload where we are comparing current and new config
in which pointers are different.
Acquires `a` read lock, but `b` is assumed to not be accessed
by anyone but the caller (`b` is not registered anywhere).


name: Account.checkStreamExportsEqual
go_file: server/accounts.go
go_class: Account
go_method: checkStreamExportsEqual
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckStreamExportsEqual
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if `a` and `b` stream exports are the same.
Acquires `a` read lock, but `b` is assumed to not be accessed
by anyone but the caller (`b` is not registered anywhere).


name: Account.checkServiceExportsEqual
go_file: server/accounts.go
go_class: Account
go_method: checkServiceExportsEqual
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckServiceExportsEqual
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if `a` and `b` service exports are the same.
Acquires `a` read lock, but `b` is assumed to not be accessed
by anyone but the caller (`b` is not registered anywhere).


name: isExportAuthEqual
go_file: server/accounts.go
go_method: isExportAuthEqual
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: IsExportAuthEqual
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if `a` and `b` exportAuth structures are equal.
Both `a` and `b` are guaranteed to be non-nil.
Locking is handled by the caller.


name: Account.hasIssuer
go_file: server/accounts.go
go_class: Account
go_method: hasIssuer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: HasIssuer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
hasIssuer returns true if the issuer matches the account
If the issuer is a scoped signing key, the scope will be returned as well
issuer or it is a signing key for the account.


name: Server.UpdateAccountClaims
go_file: server/accounts.go
go_class: Server
go_method: UpdateAccountClaims
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateAccountClaims
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
UpdateAccountClaims will update an existing account with new claims.
This will replace any exports or imports previously defined.
Lock MUST NOT be held upon entry.


name: Account.externalAuthXKey
go_file: server/accounts.go
go_class: Account
go_method: externalAuthXKey
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: ExternalAuthXKey
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Return the external authorization xkey if external authorization is enabled and the xkey is set.
Operator/Account Resolver only.


name: Server.updateAccountClaimsWithRefresh
go_file: server/accounts.go
go_class: Server
go_method: updateAccountClaimsWithRefresh
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateAccountClaimsWithRefresh
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
updateAccountClaimsWithRefresh will update an existing account with new claims.
If refreshImportingAccounts is true it will also update incomplete dependent accounts
This will replace any exports or imports previously defined.
Lock MUST NOT be held upon entry.


name: Server.buildInternalAccount
go_file: server/accounts.go
go_class: Server
go_method: buildInternalAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: BuildInternalAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper to build an internal account structure from a jwt.AccountClaims.
Lock MUST NOT be held upon entry.


name: Server.assignGlobalAccountToOrphanUsers
go_file: server/auth.go
go_class: Server
go_method: assignGlobalAccountToOrphanUsers
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AssignGlobalAccountToOrphanUsers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If Users or Nkeys options have definitions without an account defined,
assign them to the default global account.
Lock should be held.


name: validateResponsePermissions
go_file: server/auth.go
go_method: validateResponsePermissions
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: AuthHandler
dotnet_method: ValidateResponsePermissions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If the given permissions has a ResponsePermission
set, ensure that defaults are set (if values are 0)
and that a Publish permission is set, and Allow
is disabled if not explicitly set.


name: Server.buildNkeysAndUsersFromOptions
go_file: server/auth.go
go_class: Server
go_method: buildNkeysAndUsersFromOptions
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: BuildNkeysAndUsersFromOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Takes the given slices of NkeyUser and User options and build
corresponding maps used by the server. The users are cloned
so that server does not reference options.
The global account is assigned to users that don't have an
existing account.
Server lock is held on entry.


name: Server.checkAuthentication
go_file: server/auth.go
go_class: Server
go_method: checkAuthentication
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CheckAuthentication
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
checkAuthentication will check based on client type and
return boolean indicating if client is authorized.


name: Server.isClientAuthorized
go_file: server/auth.go
go_class: Server
go_method: isClientAuthorized
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: IsClientAuthorized
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isClientAuthorized will check the client against the proper authorization method and data.
This could be nkey, token, or username/password based.


name: Server.proxyCheck
go_file: server/auth.go
go_class: Server
go_method: proxyCheck
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProxyCheck
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If there are configured trusted proxies and this connection comes
from a proxy whose signature can be verified by one of the known
trusted key, this function will return `true, true`. If the signature
cannot be verified by any, it will return `true, false`.
If the connectio is not proxied, or there are no configured trusted
proxies, then this function returns `false, false`.

Server lock MUST NOT be held on entry since this function will grab
the read lock to extract the list of proxy trusted keys. The signature
verification process will be done outside of the lock.


name: Server.processProxiesTrustedKeys
go_file: server/auth.go
go_class: Server
go_method: processProxiesTrustedKeys
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessProxiesTrustedKeys
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Create a list of nkeys.KeyPair corresponding to the public keys
of the Proxies.TrustedKeys list.
Server lock must be held on entry.


name: defaultCurvePreferences
go_file: server/ciphersuites.go
go_method: defaultCurvePreferences
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CipherSuites
dotnet_method: DefaultCurvePreferences
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
reorder to default to the highest level of security.  See:
https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go


name: clientFlag.setIfNotSet
go_file: server/client.go
go_class: clientFlag
go_method: setIfNotSet
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientFlags
dotnet_method: SetIfNotSet
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
setIfNotSet will set the flag `c` only if that flag was not already
set and return true to indicate that the flag has been set. Returns
false otherwise.


name: nbPoolGet
go_file: server/client.go
go_method: nbPoolGet
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: NbPoolGet
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
nbPoolGet returns a frame that is a best-effort match for the given size.
Once a pooled frame is no longer needed, it should be recycled by passing
it to nbPoolPut.


name: nbPoolPut
go_file: server/client.go
go_method: nbPoolPut
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: NbPoolPut
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
nbPoolPut recycles a frame that was retrieved from nbPoolGet. It is not
safe to return multiple slices referring to chunks of the same underlying
array as this may create overlaps when the buffers are returned to their
original size, resulting in race conditions.


name: client.GetTLSConnectionState
go_file: server/client.go
go_class: client
go_method: GetTLSConnectionState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GetTLSConnectionState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
GetTLSConnectionState returns the TLS ConnectionState if TLS is enabled, nil
otherwise. Implements the ClientAuth interface.


name: client.clientType
go_file: server/client.go
go_class: client
go_method: clientType
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ClientType
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
For CLIENT connections, this function returns the client type, that is,
NATS (for regular clients), MQTT or WS for websocket.
If this is invoked for a non CLIENT connection, NON_CLIENT is returned.

This function does not lock the client and accesses fields that are supposed
to be immutable and therefore it can be invoked outside of the client's lock.


name: subscription.close
go_file: server/client.go
go_class: subscription
go_method: close
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Subscription
dotnet_method: Close
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Indicate that this subscription is closed.
This is used in pruning of route and gateway cache items.


name: client.Kind
go_file: server/client.go
go_class: client
go_method: Kind
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: Kind
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Kind returns the client kind and will be one of the defined constants like CLIENT, ROUTER, GATEWAY, LEAF


name: client.registerWithAccount
go_file: server/client.go
go_class: client
go_method: registerWithAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: RegisterWithAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
registerWithAccount will register the given user with a specific
account. This will change the subject namespace.


name: client.RegisterUser
go_file: server/client.go
go_class: client
go_method: RegisterUser
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: RegisterUser
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
RegisterUser allows auth to call back into a new client
with the authenticated user. This is used to map
any permissions into the client and setup accounts.


name: client.RegisterNkeyUser
go_file: server/client.go
go_class: client
go_method: RegisterNkeyUser
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: RegisterNkeyUser
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
RegisterNkeyUser allows auth to call back into a new nkey
client with the authenticated user. This is used to map
any permissions into the client and setup accounts.


name: client.mergeDenyPermissionsLocked
go_file: server/client.go
go_class: client
go_method: mergeDenyPermissionsLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MergeDenyPermissionsLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Merge client.perms structure with additional pub deny permissions
Client lock must not be held on entry


name: client.setExpiration
go_file: server/client.go
go_class: client
go_method: setExpiration
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetExpiration
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check to see if we have an expiration for the user JWT via base claims.
FIXME(dlc) - Clear on connect with new JWT.


name: client.loadMsgDenyFilter
go_file: server/client.go
go_class: client
go_method: loadMsgDenyFilter
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: LoadMsgDenyFilter
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will load up the deny structure used for filtering delivered
messages based on a deny clause for subscriptions.
Lock should be held.


name: client.flushClients
go_file: server/client.go
go_class: client
go_method: flushClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: FlushClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
flushClients will make sure to flush any clients we may have
sent to during processing. We pass in a budget as a time.Duration
for how much time to spend in place flushing for this client.


name: client.collapsePtoNB
go_file: server/client.go
go_class: client
go_method: collapsePtoNB
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: CollapsePtoNB
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
collapsePtoNB will either returned framed WebSocket buffers or it will
return a reference to c.out.nb.


name: client.flushOutbound
go_file: server/client.go
go_class: client
go_method: flushOutbound
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: FlushOutbound
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
flushOutbound will flush outbound buffer to a client.
Will return true if data was attempted to be written.
Lock must be held


name: client.handleWriteTimeout
go_file: server/client.go
go_class: client
go_method: handleWriteTimeout
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: HandleWriteTimeout
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This is invoked from flushOutbound() for io/timeout error (slow consumer).
Returns a boolean to indicate if the connection has been closed or not.
Lock is held on entry.


name: client.markConnAsClosed
go_file: server/client.go
go_class: client
go_method: markConnAsClosed
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MarkConnAsClosed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Marks this connection has closed with the given reason.
Sets the connMarkedClosed flag and skipFlushOnClose depending on the reason.
Depending on the kind of connection, the connection will be saved.
If a writeLoop has been started, the final flush will be done there, otherwise
flush and close of TCP connection is done here in place.
Returns true if closed in place, flase otherwise.
Lock is held on entry.


name: client.flushSignal
go_file: server/client.go
go_class: client
go_method: flushSignal
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: FlushSignal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
flushSignal will use server to queue the flush IO operation to a pool of flushers.
Lock must be held.


name: computeRTT
go_file: server/client.go
go_method: computeRTT
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ComputeRTT
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the RTT by computing the elapsed time since now and `start`.
On Windows VM where I (IK) run tests, time.Since() will return 0
(I suspect some time granularity issues). So return at minimum 1ns.


name: client.sendProtoNow
go_file: server/client.go
go_class: client
go_method: sendProtoNow
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendProtoNow
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Queues and then flushes the connection. This should only be called when
the writeLoop cannot be started yet. Use enqueueProto() otherwise.
Lock is held on entry.


name: client.sendRTTPingLocked
go_file: server/client.go
go_class: client
go_method: sendRTTPingLocked
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendRTTPingLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used to kick off a RTT measurement for latency tracking.
This is normally called only when the caller has checked that
the c.rtt is 0 and wants to force an update by sending a PING.
Client lock held on entry.


name: client.generateClientInfoJSON
go_file: server/client.go
go_class: client
go_method: generateClientInfoJSON
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GenerateClientInfoJSON
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Generates the INFO to be sent to the client with the client ID included.
info arg will be copied since passed by value.
Assume lock is held.


name: client.updateS2AutoCompressionLevel
go_file: server/client.go
go_class: client
go_method: updateS2AutoCompressionLevel
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: UpdateS2AutoCompressionLevel
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Select the s2 compression level based on the client's current RTT and the configured
RTT thresholds slice. If current level is different than selected one, save the
new compression level string and create a new s2 writer.
Lock held on entry.


name: client.msgParts
go_file: server/client.go
go_class: client
go_method: msgParts
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MsgParts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will return the parts from the raw wire msg.
We return the `hdr` as a slice that is capped to the length of the headers
so that if the caller later tries to append to the returned header slice it
does not affect the message content.


name: client.addShadowSubscriptions
go_file: server/client.go
go_class: client
go_method: addShadowSubscriptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: AddShadowSubscriptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
If the client's account has stream imports and there are matches for this
subscription's subject, then add shadow subscriptions in the other accounts
that export this subject.


name: client.canSubscribe
go_file: server/client.go
go_class: client
go_method: canSubscribe
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: CanSubscribe
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
canSubscribe determines if the client is authorized to subscribe to the
given subject. Assumes caller is holding lock.


name: client.checkDenySub
go_file: server/client.go
go_class: client
go_method: checkDenySub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: CheckDenySub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
checkDenySub will check if we are allowed to deliver this message in the
presence of deny clauses for subscriptions. Deny clauses will not prevent
larger scoped wildcard subscriptions, so we need to check at delivery time.
Lock should be held.


name: client.deliverMsg
go_file: server/client.go
go_class: client
go_method: deliverMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: DeliverMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
deliverMsg will deliver a message to a matching subscription and its underlying client.
We process all connection/client types. mh is the part that will be protocol/client specific.


name: client.addToPCD
go_file: server/client.go
go_class: client
go_method: addToPCD
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: AddToPCD
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Add the given sub's client to the list of clients that need flushing.
This must be invoked from `c`'s readLoop. No lock for c is required,
however, `client` lock must be held on entry. This holds true even
if `client` is same than `c`.


name: client.trackRemoteReply
go_file: server/client.go
go_class: client
go_method: trackRemoteReply
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: TrackRemoteReply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will track a remote reply for an exported service that has requested
latency tracking.
Lock assumed to be held.


name: client.pruneRemoteTracking
go_file: server/client.go
go_class: client
go_method: pruneRemoteTracking
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: PruneRemoteTracking
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
pruneRemoteTracking will prune any remote tracking objects
that are too old. These are orphaned when a service is not
sending reponses etc.
Lock should be held upon entry.


name: client.pruneReplyPerms
go_file: server/client.go
go_class: client
go_method: pruneReplyPerms
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: PruneReplyPerms
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
pruneReplyPerms will remove any stale or expired entries
in our reply cache. We make sure to not check too often.


name: client.pruneDenyCache
go_file: server/client.go
go_class: client
go_method: pruneDenyCache
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: PruneDenyCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
pruneDenyCache will prune the deny cache via randomly
deleting items. Doing so pruneSize items at a time.
Lock must be held for this one since it is shared under
deliverMsg.


name: client.prunePubPermsCache
go_file: server/client.go
go_class: client
go_method: prunePubPermsCache
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: PrunePubPermsCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
prunePubPermsCache will prune the cache via randomly
deleting items. Doing so pruneSize items at a time.


name: client.pubAllowedFullCheck
go_file: server/client.go
go_class: client
go_method: pubAllowedFullCheck
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: PubAllowedFullCheck
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
pubAllowedFullCheck checks on all publish permissioning depending
on the flag for dynamic reply permissions.


name: client.processInboundClientMsg
go_file: server/client.go
go_class: client
go_method: processInboundClientMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessInboundClientMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processInboundClientMsg is called to process an inbound msg from a client.
Return if the message was delivered, and if the message was not delivered
due to a permission issue.


name: client.handleGWReplyMap
go_file: server/client.go
go_class: client
go_method: handleGWReplyMap
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: HandleGWReplyMap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This is invoked knowing that c.pa.subject has been set to the gateway routed subject.
This function will send the message to possibly LEAFs and directly back to the origin
gateway.


name: genHeader
go_file: server/client.go
go_method: genHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GenHeader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Generate a new header based on optional original header and key value.
More used in JetStream layers.


name: client.setHeader
go_file: server/client.go
go_class: client
go_method: setHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetHeaderInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will set a header for the message.
Lock does not need to be held but this should only be called
from the inbound go routine. We will update the pubArgs.
This will replace any previously set header and not add to it per normal spec.


name: getHeader
go_file: server/client.go
go_method: getHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GetHeader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Will return a copy of the value for the header denoted by key or nil if it does not exist.
If you know that it is safe to refer to the underlying hdr slice for the period that the
return value is used, then sliceHeader() will be faster.


name: sliceHeader
go_file: server/client.go
go_method: sliceHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SliceHeader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Will return the sliced value for the header denoted by key or nil if it does not exists.
This function ignores errors and tries to achieve speed and no additional allocations.


name: getHeaderKeyIndex
go_file: server/client.go
go_method: getHeaderKeyIndex
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GetHeaderKeyIndex
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
getHeaderKeyIndex returns an index into the header slice for the given key.
Returns -1 if not found.


name: setHeader
go_file: server/client.go
go_method: setHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetHeaderStatic
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
setHeader will replace the value of the first existing key `key`
with the given value `val`, or add this new key at the end of
the headers.

Note: If the key does not exist, or if it exists but the new value
would make the resulting byte slice larger than the original one,
a new byte slice is returned and the original is left untouched.
This is to prevent situations where caller may have a `hdr` and
`msg` that are the parts of an underlying buffer. Extending the
`hdr` would otherwise overwrite the `msg` part.

If the new value is smaller, then the original `hdr` byte slice
is modified.


name: client.processServiceImport
go_file: server/client.go
go_class: client
go_method: processServiceImport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessServiceImport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processServiceImport is an internal callback when a subscription matches an imported service
from another account. This includes response mappings as well.


name: client.processMsgResults
go_file: server/client.go
go_class: client
go_method: processMsgResults
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessMsgResults
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This processes the sublist results for a given message.
Returns if the message was delivered to at least target and queue filters.


name: client.watchForStaleConnection
go_file: server/client.go
go_class: client
go_method: watchForStaleConnection
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: WatchForStaleConnection
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This is used when a connection cannot yet start to send PINGs because
the remote would not be able to handle them (case of compression,
or outbound gateway, etc...), but we still want to close the connection
if the timer has not been reset by the time we reach the time equivalent
to have sent the max number of pings.

Lock should be held


name: client.flushAndClose
go_file: server/client.go
go_class: client
go_method: flushAndClose
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: FlushAndClose
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Possibly flush the connection and then close the low level connection.
The boolean `minimalFlush` indicates if the flush operation should have a
minimal write deadline.
Lock is held on entry.


name: client.swapAccountAfterReload
go_file: server/client.go
go_class: client
go_method: swapAccountAfterReload
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SwapAccountAfterReload
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
swapAccountAfterReload will check to make sure the bound account for this client
is current. Under certain circumstances after a reload we could be pointing to
an older one.


name: client.processSubsOnConfigReload
go_file: server/client.go
go_class: client
go_method: processSubsOnConfigReload
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessSubsOnConfigReload
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processSubsOnConfigReload removes any subscriptions the client has that are no
longer authorized, and checks for imports (accounts) due to a config reload.


name: client.reconnect
go_file: server/client.go
go_class: client
go_method: reconnect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: Reconnect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Depending on the kind of connections, this may attempt to recreate a connection.
The actual reconnect attempt will be started in a go routine.


name: client.setNoReconnect
go_file: server/client.go
go_class: client
go_method: setNoReconnect
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetNoReconnect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Set the noReconnect flag. This is used before a call to closeConnection()
to prevent the connection to reconnect (routes, gateways).


name: client.getAccAndResultFromCache
go_file: server/client.go
go_class: client
go_method: getAccAndResultFromCache
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GetAccAndResultFromCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This function is used by ROUTER and GATEWAY connections to
look for a subject on a given account (since these type of
connections are not bound to a specific account).
If the c.pa.subject is found in the cache, the cached result
is returned, otherwse, we match the account's sublist and update
the cache. The cache is pruned if reaching a certain size.


name: client.doTLSHandshake
go_file: server/client.go
go_class: client
go_method: doTLSHandshake
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: DoTLSHandshake
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Performs either server or client side (if solicit is true) TLS Handshake.
On error, the TLS handshake error has been logged and the connection
has been closed.

Lock is held on entry.


name: convertAllowedConnectionTypes
go_file: server/client.go
go_method: convertAllowedConnectionTypes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ConvertAllowedConnectionTypes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Converts the given array of strings to a map of string.
The strings are converted to upper-case and added to the map only
if the server recognize them as valid connection types.
If there are unknown connection types, the map of valid ones is returned
along with an error that contains the name of the unknown.


name: client.connectionTypeAllowed
go_file: server/client.go
go_class: client
go_method: connectionTypeAllowed
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ConnectionTypeAllowed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will return true if the connection is of a type present in the given `acts` map.
Note that so far this is used only for CLIENT or LEAF connections.
But a CLIENT can be standard or websocket (and other types in the future).


name: client.isClosed
go_file: server/client.go
go_class: client
go_method: isClosed
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: IsClosed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isClosed returns true if either closeConnection or connMarkedClosed
flag have been set, or if `nc` is nil, which may happen in tests.


name: client.setFirstPingTimer
go_file: server/client.go
go_class: client
go_method: setFirstPingTimer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetFirstPingTimer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Set the very first PING to a lower interval to capture the initial RTT.
After that the PING interval will be set to the user defined value.
Client lock should be held.


name: client.setAuthError
go_file: server/client.go
go_class: client
go_method: setAuthError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetAuthError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sets this error as the authentication error. To be used in authViolation()
to report an error different of `ErrAuthentication`.


name: detectProxyProtoVersion
go_file: server/client_proxyproto.go
go_method: detectProxyProtoVersion
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: DetectProxyProtoVersion
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:24:36
description:
detectProxyProtoVersion reads the first bytes and determines protocol version.
Returns 1 for v1, 2 for v2, or error.
The first 6 bytes read are returned so they can be used by the parser.


name: readProxyProtoV1Header
go_file: server/client_proxyproto.go
go_method: readProxyProtoV1Header
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ReadProxyProtoV1Header
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:24:36
description:
readProxyProtoV1Header parses PROXY protocol v1 text format.
Expects the "PROXY " prefix (6 bytes) to have already been consumed.


name: readProxyProtoHeader
go_file: server/client_proxyproto.go
go_method: readProxyProtoHeader
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ReadProxyProtoHeader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:24:36
description:
readProxyProtoHeader reads and parses PROXY protocol (v1 or v2) from the connection.
Automatically detects version and routes to appropriate parser.
If the command is LOCAL/UNKNOWN (health check), it returns nil for addr and no error.
If the command is PROXY, it returns the parsed address information.
The connection must be fresh (no data read yet).


name: readProxyProtoV2Header
go_file: server/client_proxyproto.go
go_method: readProxyProtoV2Header
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ReadProxyProtoV2Header
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:24:36
description:
readProxyProtoV2Header is kept for backward compatibility and direct testing.
It reads and parses a PROXY protocol v2 header from the connection.
If the command is LOCAL (health check), it returns nil for addr and no error.
If the command is PROXY, it returns the parsed address information.
The connection must be fresh (no data read yet).


name: parseProxyProtoV2Header
go_file: server/client_proxyproto.go
go_method: parseProxyProtoV2Header
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ParseProxyProtoV2Header
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:24:36
description:
parseProxyProtoV2Header parses v2 protocol after signature has been validated.
header contains the 4 bytes: ver/cmd, fam/proto, addr-len (2 bytes).


name: subjectFilters.subjects
go_file: server/consumer.go
go_class: subjectFilters
go_method: subjects
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTokens
dotnet_method: Subjects
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
subjects is a helper function used for updating consumers.
It is not used and should not be used in hotpath.


name: consumer.updateInactiveThreshold
go_file: server/consumer.go
go_class: consumer
go_method: updateInactiveThreshold
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: UpdateInactiveThreshold
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Updates the consumer `dthresh` delete timer duration and set
cfg.InactiveThreshold to JsDeleteWaitTimeDefault for ephemerals
if not explicitly already specified by the user.
Lock should be held.


name: consumer.updatePauseState
go_file: server/consumer.go
go_class: consumer
go_method: updatePauseState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: UpdatePauseState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Updates the paused state. If we are the leader and the pause deadline
hasn't passed yet then we will start a timer to kick the consumer once
that deadline is reached. Lock should be held.


name: consumer.signalMonitorQuit
go_file: server/consumer.go
go_class: consumer
go_method: signalMonitorQuit
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: SignalMonitorQuit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
signalMonitorQuit signals to exit the monitor loop. If there's no Raft node,
this will be the only way to stop the monitor goroutine.


name: consumer.hasDeliveryInterest
go_file: server/consumer.go
go_class: consumer
go_method: hasDeliveryInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: HasDeliveryInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will check for extended interest in a subject. If we have local interest we just return
that, but in the absence of local interest and presence of gateways or service imports we need
to check those as well.


name: consumer.deleteNotActive
go_file: server/consumer.go
go_class: consumer
go_method: deleteNotActive
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: DeleteNotActive
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
deleteNotActive must only be called from time.AfterFunc or in its own
goroutine, as it can block on clean-up.


name: consumer.hasMaxDeliveries
go_file: server/consumer.go
go_class: consumer
go_method: hasMaxDeliveries
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: HasMaxDeliveries
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check if we have hit max deliveries. If so do notification and cleanup.
Return whether or not the max was hit.
Lock should be held.


name: consumer.addReplicatedQueuedMsg
go_file: server/consumer.go
go_class: consumer
go_method: addReplicatedQueuedMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: AddReplicatedQueuedMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Used to remember messages that need to be sent for a replicated consumer, after delivered quorum.
Lock should be held.


name: consumer.checkAndSetPendingRequestsOk
go_file: server/consumer.go
go_class: consumer
go_method: checkAndSetPendingRequestsOk
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CheckAndSetPendingRequestsOk
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Set whether or not we can send info about pending pull requests to our group.
Will require all peers have a minimum version.


name: consumer.releaseAnyPendingRequests
go_file: server/consumer.go
go_class: consumer
go_method: releaseAnyPendingRequests
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ReleaseAnyPendingRequests
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will release any pending pull requests if applicable.
Should be called only by the leader being deleted or stopped.
Lock should be held.


name: consumer.processTerm
go_file: server/consumer.go
go_class: consumer
go_method: processTerm
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ProcessTerm
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process a TERM
Returns `true` if the ack was processed in place and the sender can now respond
to the client, or `false` if there was an error or the ack is replicated (in which
case the reply will be sent later).


name: consumer.checkRedelivered
go_file: server/consumer.go
go_class: consumer
go_method: checkRedelivered
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CheckRedelivered
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Due to bug in calculation of sequences on restoring redelivered let's do quick sanity check.
Lock should be held.


name: consumer.setStoreState
go_file: server/consumer.go
go_class: consumer
go_method: setStoreState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: SetStoreState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Sets our store state from another source. Used in clustered mode on snapshot restore.
Lock should be held.


name: consumer.initialInfo
go_file: server/consumer.go
go_class: consumer
go_method: initialInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: InitialInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns an initial info. Only applicable for non-clustered consumers.
We will clear after we return it, so one shot.


name: consumer.clearInitialInfo
go_file: server/consumer.go
go_class: consumer
go_method: clearInitialInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ClearInitialInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Clears our initial info.
Used when we have a leader change in cluster mode but do not send a response.


name: consumer.processAckMsg
go_file: server/consumer.go
go_class: consumer
go_method: processAckMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ProcessAckMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process an ACK.
Returns `true` if the ack was processed in place and the sender can now respond
to the client, or `false` if there was an error or the ack is replicated (in which
case the reply will be sent later).


name: consumer.isFiltered
go_file: server/consumer.go
go_class: consumer
go_method: isFiltered
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: IsFiltered
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Determine if this is a truly filtered consumer. Modern clients will place filtered subjects
even if the stream only has a single non-wildcard subject designation.
Read lock should be held.


name: consumer.needAck
go_file: server/consumer.go
go_class: consumer
go_method: needAck
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: NeedAck
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check if we need an ack for this store seq.
This is called for interest based retention streams to remove messages.


name: waitQueue.pop
go_file: server/consumer.go
go_class: waitQueue
go_method: pop
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WaitQueue
dotnet_method: Pop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:41
description:
pop will return the next request and move the read cursor.
This will now place a request that still has pending items at the ends of the list.


name: waitQueue.popAndRequeue
go_file: server/consumer.go
go_class: waitQueue
go_method: popAndRequeue
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WaitQueue
dotnet_method: PopAndRequeue
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 14:12:07
description:
popAndRequeue pops the head element and requeues it at the end of its priority group.
This maintains FIFO order within the same priority level.


name: consumer.pendingRequests
go_file: server/consumer.go
go_class: consumer
go_method: pendingRequests
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: PendingRequests
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Return the map of pending requests keyed by the reply subject.
No-op if push consumer or invalid etc.


name: consumer.nextWaiting
go_file: server/consumer.go
go_class: consumer
go_method: nextWaiting
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: NextWaiting
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Return next waiting request. This will check for expirations but not noWait or interest.
That will be handled by processWaiting.
Lock should be held.


name: consumer.processNextMsgReq
go_file: server/consumer.go
go_class: consumer
go_method: processNextMsgReq
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ProcessNextMsgReq
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processNextMsgReq will process a request for the next message available. A nil message payload means deliver
a single message. If the payload is a formal request or a number parseable with Atoi(), then we will send a
batch of messages without requiring another request to this endpoint, or an ACK.


name: consumer.incDeliveryCount
go_file: server/consumer.go
go_class: consumer
go_method: incDeliveryCount
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: IncDeliveryCount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Increase the delivery count for this message.
ONLY used on redelivery semantics.
Lock should be held.


name: consumer.decDeliveryCount
go_file: server/consumer.go
go_class: consumer
go_method: decDeliveryCount
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: DecDeliveryCount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Used if we have to adjust on failed delivery or bad lookups.
Those failed attempts should not increase deliver count.
Lock should be held.


name: consumer.isEqualOrSubsetMatch
go_file: server/consumer.go
go_class: consumer
go_method: isEqualOrSubsetMatch
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: IsEqualOrSubsetMatch
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check if the candidate filter subject is equal to or a subset match
of one of the filter subjects.
Lock should be held.


name: consumer.getNextMsg
go_file: server/consumer.go
go_class: consumer
go_method: getNextMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: GetNextMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Get next available message from underlying store.
Is partition aware and redeliver aware.
Lock should be held.


name: consumer.processWaiting
go_file: server/consumer.go
go_class: consumer
go_method: processWaiting
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ProcessWaiting
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Will check for expiration and lack of interest on waiting requests.
Will also do any heartbeats and return the next expiration or HB interval.


name: consumer.checkAckFloor
go_file: server/consumer.go
go_class: consumer
go_method: checkAckFloor
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CheckAckFloor
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check here for conditions when our ack floor may have drifted below the streams first sequence.
In general this is accounted for in normal operations, but if the consumer misses the signal from
the stream it will not clear the message and move the ack state.
Should only be called from consumer leader.


name: consumer.loopAndGatherMsgs
go_file: server/consumer.go
go_class: consumer
go_method: loopAndGatherMsgs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: LoopAndGatherMsgs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
loopAndGatherMsgs waits for messages for the consumer. qch is the quit channel,
upch is the unpause channel which fires when the PauseUntil deadline is reached.


name: consumer.checkNumPending
go_file: server/consumer.go
go_class: consumer
go_method: checkNumPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CheckNumPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Does some sanity checks to see if we should re-calculate.
Since there is a race when decrementing when there is contention at the beginning of the stream.
The race is a getNextMsg skips a deleted msg, and then the decStreamPending call fires.
This does some quick sanity checks to see if we should re-calculate num pending.
Lock should be held.


name: consumer.checkNumPendingOnEOF
go_file: server/consumer.go
go_class: consumer
go_method: checkNumPendingOnEOF
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CheckNumPendingOnEOF
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will do a quick sanity check on num pending when we encounter
and EOF in the loop and gather.
Lock should be held.


name: consumer.streamNumPending
go_file: server/consumer.go
go_class: consumer
go_method: streamNumPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: StreamNumPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Will force a set from the stream store of num pending.
Depends on delivery policy, for last per subject we calculate differently.
Lock should be held.


name: consumer.calculateNumPending
go_file: server/consumer.go
go_class: consumer
go_method: calculateNumPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CalculateNumPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Will calculate num pending but only requires a read lock.
Depends on delivery policy, for last per subject we calculate differently.
At least RLock should be held.


name: consumer.replicateDeliveries
go_file: server/consumer.go
go_class: consumer
go_method: replicateDeliveries
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ReplicateDeliveries
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
replicateDeliveries returns whether deliveries should be replicated before sending them.
If we're replicated we MUST only send the message AFTER we've got quorum for updating
delivered state. Otherwise, we could be in an invalid state after a leader change.
We can send immediately if not replicated, not using acks, or using flow control (incompatible).
Lock should be held.


name: consumer.didNotDeliver
go_file: server/consumer.go
go_class: consumer
go_method: didNotDeliver
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: DidNotDeliver
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
didNotDeliver is called when a delivery for a consumer message failed.
Depending on our state, we will process the failure.


name: consumer.onRedeliverQueue
go_file: server/consumer.go
go_class: consumer
go_method: onRedeliverQueue
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: OnRedeliverQueue
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This checks if we already have this sequence queued for redelivery.
FIXME(dlc) - This is O(n) but should be fast with small redeliver size.
Lock should be held.


name: consumer.hasSkipListPending
go_file: server/consumer.go
go_class: consumer
go_method: hasSkipListPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: HasSkipListPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Let's us know we have a skip list, which is for deliver last per subject and we are just starting.
Lock should be held.


name: consumer.purge
go_file: server/consumer.go
go_class: consumer
go_method: purge
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: Purge
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This is when the underlying stream has been purged.
sseq is the new first seq for the stream after purge.
Consumer lock should NOT be held but the parent stream
lock MUST be held.


name: consumer.cleanupNoInterestMessages
go_file: server/consumer.go
go_class: consumer
go_method: cleanupNoInterestMessages
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CleanupNoInterestMessages
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
We need to optionally remove all messages since we are interest based retention.
We will do this consistently on all replicas. Note that if in clustered mode the non-leader
consumers will need to restore state first.
ignoreInterest marks whether the consumer should be ignored when determining interest.
No lock held on entry.


name: deliveryFormsCycle
go_file: server/consumer.go
go_method: deliveryFormsCycle
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: DeliveryFormsCycle
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check that we do not form a cycle by delivering to a delivery subject
that is part of the interest group.


name: consumer.requestNextMsgSubject
go_file: server/consumer.go
go_class: consumer
go_method: requestNextMsgSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: RequestNextMsgSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
RequestNextMsgSubject returns the subject to request the next message when in pull or worker mode.
Returns empty otherwise.


name: consumer.processStreamSignal
go_file: server/consumer.go
go_class: consumer
go_method: processStreamSignal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ProcessStreamSignal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This is what will be called when our parent stream wants to kick us regarding a new message.
We know that this subject matches us by how the parent handles registering us with the signaling sublist,
but we must check if we are leader.
We do need the sequence of the message however and we use the msg as the encoded seq.


name: gatherSubjectFilters
go_file: server/consumer.go
go_method: gatherSubjectFilters
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: GatherSubjectFilters
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Utility for simpler if conditions in Consumer config checks.
In future iteration, we can immediately create `o.subjf` and
use it to validate things.


name: consumer.shouldStartMonitor
go_file: server/consumer.go
go_class: consumer
go_method: shouldStartMonitor
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ShouldStartMonitor
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
shouldStartMonitor will return true if we should start a monitor
goroutine or will return false if one is already running.


name: consumer.clearMonitorRunning
go_file: server/consumer.go
go_class: consumer
go_method: clearMonitorRunning
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: ClearMonitorRunning
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Clear the monitor running state. The monitor goroutine should
call this in a defer to clean up on exit.


name: consumer.checkStateForInterestStream
go_file: server/consumer.go
go_class: consumer
go_method: checkStateForInterestStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: CheckStateForInterestStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
If we are a consumer of an interest or workqueue policy stream, process that state and make sure consistent.


name: NewExpiringDirJWTStore
go_file: server/dirstore.go
go_method: NewExpiringDirJWTStore
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: DirJwtStore
dotnet_method: NewExpiringDirJWTStore
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Creates a directory based jwt store.

When ttl is set deletion of file is based on it and not on the jwt expiration
To completely disable expiration (including expiration in jwt) set ttl to max duration time.Duration(math.MaxInt64)

limit defines how many files are allowed at any given time. Set to math.MaxInt64 to disable.
evictOnLimit determines the behavior once limit is reached.
* true - Evict based on lru strategy
* false - return an error


name: DirJWTStore.Merge
go_file: server/dirstore.go
go_class: DirJWTStore
go_method: Merge
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: DirJwtStore
dotnet_method: Merge
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Merge takes the JWTs from package and adds them to the store
Merge is destructive in the sense that it doesn't check if the JWT
is newer or anything like that.


name: DirJWTStore.write
go_file: server/dirstore.go
go_class: DirJWTStore
go_method: write
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: DirJwtStore
dotnet_method: Write
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
write that keeps hash of all jwt in sync
Assumes the lock is held. Does return true or an error never both.


name: DirJWTStore.saveIfNewer
go_file: server/dirstore.go
go_class: DirJWTStore
go_method: saveIfNewer
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: DirJwtStore
dotnet_method: SaveIfNewer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Assumes the lock is NOT held, and only updates if the jwt is new, or the one on disk is older
When changed, invokes jwt changed callback


name: processConfigErr.Error
go_file: server/errors.go
go_class: processConfigErr
go_method: Error
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerErrors,ErrorCtx,ErrorContextHelper
dotnet_method: ProcessConfigErrError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:01:56
description:
Error returns the collection of errors separated by new lines,
warnings appear first then hard errors.


name: errorsUnwrap
go_file: server/errors.go
go_method: errorsUnwrap
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerErrors,ErrorCtx,ErrorContextHelper
dotnet_method: ErrorsUnwrap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:01:56
description:
implements: go 1.13 errors.Unwrap(err error) error
TODO replace with native code once we no longer support go1.12


name: ErrorIs
go_file: server/errors.go
go_method: ErrorIs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerErrors,ErrorCtx,ErrorContextHelper
dotnet_method: ErrorIs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ErrorIs implements: go 1.13 errors.Is(err, target error) bool
TODO replace with native code once we no longer support go1.12


name: panicIfErr
go_file: server/errors_gen.go
go_method: panicIfErr
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerErrors
dotnet_method: PanicIfErr
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:33
notes:
Go build tool (go:build ignore), generates jetstream_errors_generated.go — no .NET equivalent needed


name: ServerInfo.AccountNRG
go_file: server/events.go
go_class: ServerInfo
go_method: AccountNRG
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerInfo
dotnet_method: AccountNRG
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
AccountNRG indicates whether or not we support moving the NRG traffic out of the
system account and into the asset account.


name: Server.internalReceiveLoop
go_file: server/events.go
go_class: Server
go_method: internalReceiveLoop
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InternalReceiveLoop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
internalReceiveLoop will be responsible for dispatching all messages that
a server receives and needs to internally process, e.g. internal subs.


name: Server.sendLDMShutdownEventLocked
go_file: server/events.go
go_class: Server
go_method: sendLDMShutdownEventLocked
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendLDMShutdownEventLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Will send a shutdown message for lame-duck. Unlike sendShutdownEvent, this will
not close off the send queue or reply handler, as we may still have a workload
that needs migrating off.
Lock should be held.


name: Server.TrackedRemoteServers
go_file: server/events.go
go_class: Server
go_method: TrackedRemoteServers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: TrackedRemoteServers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
TrackedRemoteServers returns how many remote servers we are tracking
from a system events perspective.


name: Server.checkRemoteServers
go_file: server/events.go
go_class: Server
go_method: checkRemoteServers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CheckRemoteServers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check for orphan servers who may have gone away without notification.
This should be wrapChk() to setup common locking.


name: Server.startRemoteServerSweepTimer
go_file: server/events.go
go_class: Server
go_method: startRemoteServerSweepTimer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StartRemoteServerSweepTimer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Start a ticker that will fire periodically and check for orphaned servers.
This should be wrapChk() to setup common locking.


name: Server.initEventTracking
go_file: server/events.go
go_class: Server
go_method: initEventTracking
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InitEventTracking
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will setup our system wide tracking subs.
For now we will setup one wildcard subscription to
monitor all accounts for changes in number of connections.
We can make this on a per account tracking basis if needed.
Tradeoff is subscription and interest graph events vs connect and
disconnect events, etc.


name: Server.processRemoteServerShutdown
go_file: server/events.go
go_class: Server
go_method: processRemoteServerShutdown
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessRemoteServerShutdown
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
processRemoteServerShutdown will update any affected accounts.
Will update the remote count for clients.
Lock assume held.


name: Server.updateRemoteServer
go_file: server/events.go
go_class: Server
go_method: updateRemoteServer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateRemoteServer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
updateRemoteServer is called when we have an update from a remote server.
This allows us to track remote servers, respond to shutdown messages properly,
make sure that messages are ordered, and allow us to prune dead servers.
Lock should be held upon entry.


name: Server.processNewServer
go_file: server/events.go
go_class: Server
go_method: processNewServer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessNewServer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
processNewServer will hold any logic we want to use when we discover a new server.
Lock should be held upon entry.


name: Server.updateNRGAccountStatus
go_file: server/events.go
go_class: Server
go_method: updateNRGAccountStatus
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateNRGAccountStatus
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Works out whether all nodes support moving the NRG traffic into
the account and moves it appropriately.
Server lock MUST NOT be held on entry.


name: Server.ensureGWsInterestOnlyForLeafNodes
go_file: server/events.go
go_class: Server
go_method: ensureGWsInterestOnlyForLeafNodes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: EnsureGWsInterestOnlyForLeafNodes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If GW is enabled on this server and there are any leaf node connections,
this function will send a LeafNode connect system event to the super cluster
to ensure that the GWs are in interest-only mode for this account.
Lock should be held upon entry.
TODO(dlc) - this will cause this account to be loaded on all servers. Need a better
way with GW2.


name: Server.filterRequest
go_file: server/events.go
go_class: Server
go_method: filterRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: FilterRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
returns true if the request does NOT apply to this server and can be ignored.
DO NOT hold the server lock when calling this.


name: Server.idzReq
go_file: server/events.go
go_class: Server
go_method: idzReq
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: IdzReq
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
idzReq is for a request for basic static server info.
Try to not hold the write lock or dynamically create data.


name: Server.enableAccountTracking
go_file: server/events.go
go_class: Server
go_method: enableAccountTracking
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: EnableAccountTracking
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Setup tracking for this account. This allows us to track global account activity.
Lock should be held on entry.


name: Server.sendAccConnsUpdate
go_file: server/events.go
go_class: Server
go_method: sendAccConnsUpdate
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendAccConnsUpdate
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
sendAccConnsUpdate is called to send out our information on the
account's local connections.
Lock should be held on entry.


name: Server.accConnsUpdate
go_file: server/events.go
go_class: Server
go_method: accConnsUpdate
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AccConnsUpdate
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
accConnsUpdate is called whenever there is a change to the account's
number of active connections, or during a heartbeat.
We will not send for $G.


name: Server.accountConnectEvent
go_file: server/events.go
go_class: Server
go_method: accountConnectEvent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AccountConnectEvent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
accountConnectEvent will send an account client connect event if there is interest.
This is a billing event.


name: Server.accountDisconnectEvent
go_file: server/events.go
go_class: Server
go_method: accountDisconnectEvent
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AccountDisconnectEvent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
accountDisconnectEvent will send an account client disconnect event if there is interest.
This is a billing event.


name: Server.noInlineCallback
go_file: server/events.go
go_class: Server
go_method: noInlineCallback
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NoInlineCallback
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Create a wrapped callback handler for the subscription that will move it to an
internal recvQ for processing not inline with routes etc.


name: Server.noInlineCallbackStatsz
go_file: server/events.go
go_class: Server
go_method: noInlineCallbackStatsz
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NoInlineCallbackStatsz
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Create a wrapped callback handler for the subscription that will move it to an
internal recvQ for Statsz/Pings for processing not inline with routes etc.


name: Server.noInlineCallbackRecvQSelect
go_file: server/events.go
go_class: Server
go_method: noInlineCallbackRecvQSelect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NoInlineCallbackRecvQSelect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Create a wrapped callback handler for the subscription that will move it to an
internal IPQueue for processing not inline with routes etc.


name: Server.inboxReply
go_file: server/events.go
go_class: Server
go_method: inboxReply
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InboxReply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is used for all inbox replies so that we do not send supercluster wide interest
updates for every request. Same trick used in modern NATS clients.


name: Server.debugSubscribers
go_file: server/events.go
go_class: Server
go_method: debugSubscribers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: DebugSubscribers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Allows users of large systems to debug active subscribers for a given subject.
Payload should be the subject of interest.


name: Server.nsubsRequest
go_file: server/events.go
go_class: Server
go_method: nsubsRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NsubsRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Request for our local subscription count. This will come from a remote origin server
that received the initial request.


name: Server.sendOCSPPeerRejectEvent
go_file: server/events.go
go_class: Server
go_method: sendOCSPPeerRejectEvent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendOCSPPeerRejectEvent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
sendOCSPPeerRejectEvent sends a system level event to system account when a peer connection is
rejected due to OCSP invalid status of its trust chain(s).


name: Server.sendOCSPPeerChainlinkInvalidEvent
go_file: server/events.go
go_class: Server
go_method: sendOCSPPeerChainlinkInvalidEvent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendOCSPPeerChainlinkInvalidEvent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
sendOCSPPeerChainlinkInvalidEvent sends a system level event to system account when a link in a peer's trust chain
is OCSP invalid.


name: msgBlock.checkAndLoadEncryption
go_file: server/filestore.go
go_class: msgBlock
go_method: checkAndLoadEncryption
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: CheckAndLoadEncryption
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check for encryption, we do not load keys on startup anymore so might need to load them here.
Lock for fs should be held.


name: msgBlock.rebuildState
go_file: server/filestore.go
go_class: msgBlock
go_method: rebuildState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: RebuildState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Rebuild the state of the blk based on what we have on disk in the N.blk file.
We will return any lost data, and we will return any delete tombstones we encountered.


name: fileStore.recoverFullState
go_file: server/filestore.go
go_class: fileStore
go_method: recoverFullState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: RecoverFullState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
recoverFullState will attempt to receover our last full state and re-process any state changes
that happened afterwards.


name: fileStore.expireMsgsOnRecover
go_file: server/filestore.go
go_class: fileStore
go_method: expireMsgsOnRecover
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: ExpireMsgsOnRecover
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will expire msgs that have aged out on restart.
We will treat this differently in case we have a recovery
that will expire alot of messages on startup.
Should only be called on startup.


name: fileStore.FilteredState
go_file: server/filestore.go
go_class: fileStore
go_method: FilteredState
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: FilteredState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
FilteredState will return the SimpleState associated with the filtered subject and a proposed starting sequence.


name: fileStore.checkSkipFirstBlock
go_file: server/filestore.go
go_class: fileStore
go_method: checkSkipFirstBlock
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: CheckSkipFirstBlock
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is used to see if we can selectively jump start blocks based on filter subject and a starting block index.
Will return -1 and ErrStoreEOF if no matches at all or no more from where we are.


name: fileStore.checkSkipFirstBlockMulti
go_file: server/filestore.go
go_class: fileStore
go_method: checkSkipFirstBlockMulti
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: CheckSkipFirstBlockMulti
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is used to see if we can selectively jump start blocks based on filter subjects and a starting block index.
Will return -1 and ErrStoreEOF if no matches at all or no more from where we are.


name: fileStore.numFilteredPendingNoLast
go_file: server/filestore.go
go_class: fileStore
go_method: numFilteredPendingNoLast
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: NumFilteredPendingNoLast
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Optimized way for getting all num pending matching a filter subject and first sequence only.
Lock should be held.


name: fileStore.numFilteredPendingWithLast
go_file: server/filestore.go
go_class: fileStore
go_method: numFilteredPendingWithLast
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: NumFilteredPendingWithLast
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Optimized way for getting all num pending matching a filter subject.
Optionally look up last sequence. Sometimes do not need last and this avoids cost.
Read lock should be held.


name: fileStore.allLastSeqsLocked
go_file: server/filestore.go
go_class: fileStore
go_method: allLastSeqsLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: AllLastSeqsLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
allLastSeqsLocked will return a sorted list of last sequences for all
subjects, but won't take the lock to do it, to avoid the issue of compounding
read locks causing a deadlock with a write lock.


name: fileStore.filterIsAll
go_file: server/filestore.go
go_class: fileStore
go_method: filterIsAll
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: FilterIsAll
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper to determine if the filter(s) represent all the subjects.
Most clients send in subjects even if they match the stream's ingest subjects.
Lock should be held.


name: fileStore.MultiLastSeqs
go_file: server/filestore.go
go_class: fileStore
go_method: MultiLastSeqs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: MultiLastSeqs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
MultiLastSeqs will return a sorted list of sequences that match all subjects presented in filters.
We will not exceed the maxSeq, which if 0 becomes the store's last sequence.


name: fileStore.NumPending
go_file: server/filestore.go
go_class: fileStore
go_method: NumPending
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: NumPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
NumPending will return the number of pending messages matching the filter subject starting at sequence.
Optimized for stream num pending calculations for consumers.


name: fileStore.NumPendingMulti
go_file: server/filestore.go
go_class: fileStore
go_method: NumPendingMulti
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: NumPendingMulti
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
NumPending will return the number of pending messages matching any subject in the sublist starting at sequence.
Optimized for stream num pending calculations for consumers with lots of filtered subjects.
Subjects should not overlap, this property is held when doing multi-filtered consumers.


name: fileStore.RegisterStorageUpdates
go_file: server/filestore.go
go_class: fileStore
go_method: RegisterStorageUpdates
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: RegisterStorageUpdates
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
RegisterStorageUpdates registers a callback for updates to storage changes.
It will present number of messages and bytes as a signed integer and an
optional sequence number of the message if a single.


name: fileStore.RegisterStorageRemoveMsg
go_file: server/filestore.go
go_class: fileStore
go_method: RegisterStorageRemoveMsg
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: RegisterStorageRemoveMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
RegisterStorageRemoveMsg registers a callback to remove messages.
Replicated streams should propose removals, R1 can remove inline.


name: msgBlock.finishedWithCache
go_file: server/filestore.go
go_class: msgBlock
go_method: finishedWithCache
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: FinishedWithCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
finishedWithCache removes the strong reference to the cache, instead
returning it to the elastic pointer. Note that the elastic pointer can
be either weak or strong, they are strengthened when there are pending
writes and weak otherwise.
Lock must be held.


name: msgBlock.skipMsg
go_file: server/filestore.go
go_class: msgBlock
go_method: skipMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: SkipMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
skipMsg will update this message block for a skipped message.
If we do not have any messages, just update the metadata, otherwise
we will place an empty record marking the sequence as used. The
sequence will be marked erased.
fs lock should be held.


name: fileStore.SkipMsgs
go_file: server/filestore.go
go_class: fileStore
go_method: SkipMsgs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: SkipMsgs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
Skip multiple msgs. We will determine if we can fit into current lmb or we need to create a new block.


name: fileStore.firstSeqForSubj
go_file: server/filestore.go
go_class: fileStore
go_method: firstSeqForSubj
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: FirstSeqForSubj
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Optimized helper function to return first sequence.
subj will always be publish subject here, meaning non-wildcard.
We assume a fast check that this subj even exists already happened.
Write lock should be held.


name: fileStore.enforceMsgPerSubjectLimit
go_file: server/filestore.go
go_class: fileStore
go_method: enforceMsgPerSubjectLimit
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: EnforceMsgPerSubjectLimit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will make sure we have limits honored for max msgs per subject on recovery or config update.
We will make sure to go through all msg blocks etc. but in practice this
will most likely only be the last one, so can take a more conservative approach.
Lock should be held.


name: fileStore.removeMsgViaLimits
go_file: server/filestore.go
go_class: fileStore
go_method: removeMsgViaLimits
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: RemoveMsgViaLimits
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If we remove via limits that can always be recovered on a restart we
do not force the system to update the index file.
Lock should be held.


name: msgBlock.shouldCompactInline
go_file: server/filestore.go
go_class: msgBlock
go_method: shouldCompactInline
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: ShouldCompactInline
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Tests whether we should try to compact this block while inline removing msgs.
We will want rbytes to be over the minimum and have a 2x potential savings.
If we compacted before but rbytes didn't improve much, guard against constantly compacting.
Lock should be held.


name: msgBlock.shouldCompactSync
go_file: server/filestore.go
go_class: msgBlock
go_method: shouldCompactSync
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: ShouldCompactSync
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Tests whether we should try to compact this block while running periodic sync.
We will want rbytes to be over the minimum and have a 2x potential savings.
Ignores 2MB minimum.
Lock should be held.


name: msgBlock.compact
go_file: server/filestore.go
go_class: msgBlock
go_method: compact
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: Compact
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will compact and rewrite this block. This version will not process any tombstone cleanup.
Write lock needs to be held.


name: msgBlock.compactWithFloor
go_file: server/filestore.go
go_class: msgBlock
go_method: compactWithFloor
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: CompactWithFloor
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will compact and rewrite this block. This should only be called when we know we want to rewrite this block.
This should not be called on the lmb since we will prune tail deleted messages which could cause issues with
writing new messages. We will silently bail on any issues with the underlying block and let someone else detect.
if fseq > 0 we will attempt to cleanup stale tombstones.
Write lock needs to be held.


name: fileStore.selectNextFirst
go_file: server/filestore.go
go_class: fileStore
go_method: selectNextFirst
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: SelectNextFirst
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Select the next FirstSeq
Also cleans up empty blocks at the start only containing tombstones.
Lock should be held.


name: msgBlock.tryExpireWriteCache
go_file: server/filestore.go
go_class: msgBlock
go_method: tryExpireWriteCache
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: TryExpireWriteCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is for expiration of the write cache, which will be partial with fip.
So we want to bypass the Pools here.
Lock should be held.


name: msgBlock.writeMsgRecordLocked
go_file: server/filestore.go
go_class: msgBlock
go_method: writeMsgRecordLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: WriteMsgRecordLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will write the message record to the underlying message block.
filestore lock will be held.
mb lock should be held.


name: msgBlock.bytesPending
go_file: server/filestore.go
go_class: msgBlock
go_method: bytesPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: BytesPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
bytesPending returns the buffer to be used for writing to the underlying file.
This marks we are in flush and will return nil if asked again until cleared.
Lock should be held.


name: fileStore.writeTombstone
go_file: server/filestore.go
go_class: fileStore
go_method: writeTombstone
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: WriteTombstone
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
For writing tombstones to our lmb. This version will enforce maximum block sizes.
Lock should be held.


name: fileStore.writeTombstoneNoFlush
go_file: server/filestore.go
go_class: fileStore
go_method: writeTombstoneNoFlush
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: WriteTombstoneNoFlush
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
For writing tombstones to our lmb. This version will enforce maximum block sizes.
This version does not flush contents.
Lock should be held.


name: fileStore.selectMsgBlock
go_file: server/filestore.go
go_class: fileStore
go_method: selectMsgBlock
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: SelectMsgBlock
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Select the message block where this message should be found.
Return nil if not in the set.
Read lock should be held.


name: msgBlock.fetchMsg
go_file: server/filestore.go
go_class: msgBlock
go_method: fetchMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: FetchMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Fetch a message from this block, possibly reading in and caching the messages.
We assume the block was selected and is correct, so we do not do range checks.
Lock should not be held.


name: msgBlock.fetchMsgNoCopy
go_file: server/filestore.go
go_class: msgBlock
go_method: fetchMsgNoCopy
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: FetchMsgNoCopy
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Fetch a message from this block, possibly reading in and caching the messages.
We assume the block was selected and is correct, so we do not do range checks.
We will not copy the msg data.
Lock should not be held.


name: msgBlock.fetchMsgEx
go_file: server/filestore.go
go_class: msgBlock
go_method: fetchMsgEx
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: FetchMsgEx
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Fetch a message from this block, possibly reading in and caching the messages.
We assume the block was selected and is correct, so we do not do range checks.
We will copy the msg data based on doCopy boolean.
Lock should not be held.


name: fileStore.sizeForSeq
go_file: server/filestore.go
go_class: fileStore
go_method: sizeForSeq
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: SizeForSeq
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used when we are checking if discarding a message due to max msgs per subject will give us
enough room for a max bytes condition.
Lock should be already held.


name: msgBlock.msgFromBuf
go_file: server/filestore.go
go_class: msgBlock
go_method: msgFromBuf
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: MsgFromBuf
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Internal function to return msg parts from a raw buffer.
Raw buffer will be copied into sm.
Lock should be held.


name: msgBlock.msgFromBufNoCopy
go_file: server/filestore.go
go_class: msgBlock
go_method: msgFromBufNoCopy
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: MsgFromBufNoCopy
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Internal function to return msg parts from a raw buffer.
Raw buffer will NOT be copied into sm.
Only use for internal use, any message that is passed to upper layers should use mb.msgFromBuf.
Lock should be held.


name: msgBlock.msgFromBufEx
go_file: server/filestore.go
go_class: msgBlock
go_method: msgFromBufEx
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: MsgFromBufEx
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Internal function to return msg parts from a raw buffer.
copy boolean will determine if we make a copy or not.
Lock should be held.


name: fileStore.LoadLastMsg
go_file: server/filestore.go
go_class: fileStore
go_method: LoadLastMsg
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: LoadLastMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
LoadLastMsg will return the last message we have that matches a given subject.
The subject can be a wildcard.


name: fileStore.FastState
go_file: server/filestore.go
go_class: fileStore
go_method: FastState
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: FastState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
FastState will fill in state with only the following.
Msgs, Bytes, First and Last Sequence and Time and NumDeleted.


name: fileStore.PurgeEx
go_file: server/filestore.go
go_class: fileStore
go_method: PurgeEx
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: PurgeEx
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
PurgeEx will remove messages based on subject filters, sequence and number of messages to keep.
Will return the number of purged messages.


name: fileStore.Compact
go_file: server/filestore.go
go_class: fileStore
go_method: Compact
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: Compact
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
Compact will remove all messages from this store up to
but not including the seq parameter.
Will return the number of purged messages.


name: msgBlock.numPriorTombsLocked
go_file: server/filestore.go
go_class: msgBlock
go_method: numPriorTombsLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: NumPriorTombsLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Return number of tombstones for messages prior to this msgBlock.
Both locks should be held.
Write lock should be held for block.


name: fileStore.forceRemoveMsgBlock
go_file: server/filestore.go
go_class: fileStore
go_method: forceRemoveMsgBlock
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: ForceRemoveMsgBlock
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Removes the msgBlock, without writing tombstones to ensure the last sequence is preserved.
Both locks should be held.


name: msgBlock.recalculateForSubj
go_file: server/filestore.go
go_class: msgBlock
go_method: recalculateForSubj
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: RecalculateForSubj
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will recalculate the first and/or last sequence for this subject in this block.
Will avoid slower path message lookups and scan the cache directly instead.


name: msgBlock.generatePerSubjectInfo
go_file: server/filestore.go
go_class: msgBlock
go_method: generatePerSubjectInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageBlock
dotnet_method: GeneratePerSubjectInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
generatePerSubjectInfo will generate the per subject info via the raw msg block.
Lock should be held.


name: fileStore.writeFullState
go_file: server/filestore.go
go_class: fileStore
go_method: writeFullState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: WriteFullState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
writeFullState will proceed to write the full meta state iff not complex and time consuming.
Since this is for quick recovery it is optional and should not block/stall normal operations.


name: fileStore._writeFullState
go_file: server/filestore.go
go_class: fileStore
go_method: _writeFullState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: WriteFullState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will write the full binary state for the stream.
This plus everything new since last hash will be the total recovered state.
This state dump will have the following.
1. Stream summary - Msgs, Bytes, First and Last (Sequence and Timestamp)
2. PSIM - Per Subject Index Map - Tracks first and last blocks with subjects present.
3. MBs - Index, Bytes, First and Last Sequence and Timestamps, and the deleted map (avl.seqset).
4. Last block index and hash of record inclusive to this stream state.


name: fileStore.deleteBlocks
go_file: server/filestore.go
go_class: fileStore
go_method: deleteBlocks
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: DeleteBlocks
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
deleteBlocks returns DeleteBlocks representing interior deletes
and gaps between blocks.
All blocks should be at least read locked.


name: fileStore.deleteMap
go_file: server/filestore.go
go_class: fileStore
go_method: deleteMap
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: DeleteMap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
deleteMap returns all interior deletes for each block based on the mb.dmap.
Specifically, this will not contain any deletes for blocks that have been removed.
This is useful to know whether a tombstone is still relevant and marked as deleted by an active block.
No locks should be held.


name: fileStore.SyncDeleted
go_file: server/filestore.go
go_class: fileStore
go_method: SyncDeleted
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: SyncDeleted
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
SyncDeleted will make sure this stream has same deleted state as dbs.
This will only process deleted state within our current state.


name: consumerFileStore.encryptState
go_file: server/filestore.go
go_class: consumerFileStore
go_method: encryptState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ConsumerFileStore
dotnet_method: EncryptState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will encrypt the state with our asset key. Will be a no-op if encryption not enabled.
Lock should be held.


name: init
go_file: server/filestore.go
go_method: init
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: Init
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used to setup our simplistic counting semaphore using buffered channels.
golang.org's semaphore seemed a bit heavy.


name: consumerFileStore.State
go_file: server/filestore.go
go_class: consumerFileStore
go_method: State
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ConsumerFileStore
dotnet_method: State
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:35
description:
State retrieves the state from the state file.
This is not expected to be called in high performance code, only on startup.


name: fileStore.writeFileWithOptionalSync
go_file: server/filestore.go
go_class: fileStore
go_method: writeFileWithOptionalSync
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamFileStore
dotnet_method: WriteFileWithOptionalSync
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
writeFileWithOptionalSync is equivalent to os.WriteFile() but optionally
sets O_SYNC on the open file if SyncAlways is set. The dios semaphore is
handled automatically by this function, so don't wrap calls to it in dios.


name: SetGatewaysSolicitDelay
go_file: server/gateway.go
go_method: SetGatewaysSolicitDelay
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayHandler
dotnet_method: SetGatewaysSolicitDelay
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
SetGatewaysSolicitDelay sets the initial delay before gateways
connections are initiated.
Used by tests.


name: ResetGatewaysSolicitDelay
go_file: server/gateway.go
go_method: ResetGatewaysSolicitDelay
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayHandler
dotnet_method: ResetGatewaysSolicitDelay
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ResetGatewaysSolicitDelay resets the initial delay before gateways
connections are initiated to its default values.
Used by tests.


name: GatewayDoNotForceInterestOnlyMode
go_file: server/gateway.go
go_method: GatewayDoNotForceInterestOnlyMode
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayHandler
dotnet_method: GatewayDoNotForceInterestOnlyMode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
GatewayDoNotForceInterestOnlyMode is used ONLY in tests.
DO NOT USE in normal code or if you embed the NATS Server.


name: gwReplyMapping.get
go_file: server/gateway.go
go_class: gwReplyMapping
go_method: get
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GwReplyMapping
dotnet_method: Get
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the corresponding gw routed subject, and `true` to indicate that a
mapping was found. If no entry is found, the passed subject is returned
as-is and `false` is returned to indicate that no mapping was found.
Caller is responsible to ensure the locking.


name: Server.newGateway
go_file: server/gateway.go
go_class: Server
go_method: newGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NewGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Initialize the s.gateway structure. We do this even if the server
does not have a gateway configured. In some part of the code, the
server will check the number of outbound gateways, etc.. and so
we don't have to check if s.gateway is nil or not.


name: Server.startGateways
go_file: server/gateway.go
go_class: Server
go_method: startGateways
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StartGateways
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Starts the gateways accept loop and solicit explicit gateways
after an initial delay. This delay is meant to give a chance to
the cluster to form and this server gathers gateway URLs for this
cluster in order to send that as part of the connect/info process.


name: Server.startGatewayAcceptLoop
go_file: server/gateway.go
go_class: Server
go_method: startGatewayAcceptLoop
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StartGatewayAcceptLoop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This starts the gateway accept loop in a go routine, unless it
is detected that the server has already been shutdown.


name: Server.solicitGateways
go_file: server/gateway.go
go_class: Server
go_method: solicitGateways
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SolicitGateways
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Goes through the list of registered gateways and try to connect to those.
The list (remotes) is initially containing the explicit remote gateways,
but the list is augmented with any implicit (discovered) gateway. Therefore,
this function only solicit explicit ones.


name: Server.reconnectGateway
go_file: server/gateway.go
go_class: Server
go_method: reconnectGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReconnectGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Reconnect to the gateway after a little wait period. For explicit
gateways, we also wait for the default reconnect time.


name: Server.solicitGateway
go_file: server/gateway.go
go_class: Server
go_method: solicitGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SolicitGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This function will loop trying to connect to any URL attached
to the given Gateway. It will return once a connection has been created.


name: Server.createGateway
go_file: server/gateway.go
go_class: Server
go_method: createGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CreateGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Called when a gateway connection is either accepted or solicited.
If accepted, the gateway is marked as inbound.
If solicited, the gateway is marked as outbound.


name: client.processGatewayConnect
go_file: server/gateway.go
go_class: client
go_method: processGatewayConnect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessGatewayConnect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process the CONNECT protocol from a gateway connection.
Returns an error to the connection if the CONNECT is not from a gateway
(for instance a client or route connecting to the gateway port), or
if the destination does not match the gateway name of this server.

<Invoked from inbound connection's readLoop>


name: client.processGatewayInfo
go_file: server/gateway.go
go_class: client
go_method: processGatewayInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessGatewayInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process the INFO protocol from a gateway connection.

If the gateway connection is an outbound (this server initiated the connection),
this function checks that the incoming INFO contains the Gateway field. If empty,
it means that this is a response from an older server or that this server connected
to the wrong port.
The outbound gateway may also receive a gossip INFO protocol from the remote gateway,
indicating other gateways that the remote knows about. This server will try to connect
to those gateways (if not explicitly configured or already implicitly connected).
In both cases (explicit or implicit), the local cluster is notified about the existence
of this new gateway. This allows servers in the cluster to ensure that they have an
outbound connection to this gateway.

For an inbound gateway, the gateway is simply registered and the info protocol
is saved to be used after processing the CONNECT.

<Invoked from both inbound/outbound readLoop's connection>


name: Server.gossipGatewaysToInboundGateway
go_file: server/gateway.go
go_class: Server
go_method: gossipGatewaysToInboundGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GossipGatewaysToInboundGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sends to the given inbound gateway connection a gossip INFO protocol
for each gateway known by this server. This allows for a "full mesh"
of gateways.


name: Server.sendQueueSubsToGateway
go_file: server/gateway.go
go_class: Server
go_method: sendQueueSubsToGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendQueueSubsToGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sends queue subscriptions interest to remote gateway.
This is sent from the inbound side, that is, the side that receives
messages from the remote's outbound connection. This side is
the one sending the subscription interest.


name: Server.sendAccountSubsToGateway
go_file: server/gateway.go
go_class: Server
go_method: sendAccountSubsToGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendAccountSubsToGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sends all subscriptions for the given account to the remove gateway
This is sent from the inbound side, that is, the side that receives
messages from the remote's outbound connection. This side is
the one sending the subscription interest.


name: Server.processGatewayInfoFromRoute
go_file: server/gateway.go
go_class: Server
go_method: processGatewayInfoFromRoute
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessGatewayInfoFromRoute
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is invoked when getting an INFO protocol for gateway on the ROUTER port.
This function will then execute appropriate function based on the command
contained in the protocol.
<Invoked from a route connection's readLoop>


name: Server.sendGatewayConfigsToRoute
go_file: server/gateway.go
go_class: Server
go_method: sendGatewayConfigsToRoute
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendGatewayConfigsToRoute
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sends INFO protocols to the given route connection for each known Gateway.
These will be processed by the route and delegated to the gateway code to
invoke processImplicitGateway.


name: Server.processImplicitGateway
go_file: server/gateway.go
go_class: Server
go_method: processImplicitGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessImplicitGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Initiates a gateway connection using the info contained in the INFO protocol.
If a gateway with the same name is already registered (either because explicitly
configured, or already implicitly connected), this function will augmment the
remote URLs with URLs present in the info protocol and return.
Otherwise, this function will register this remote (to prevent multiple connections
to the same remote) and call solicitGateway (which will run in a different go-routine).


name: gatewayCfg.updateURLs
go_file: server/gateway.go
go_class: gatewayCfg
go_method: updateURLs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayCfg
dotnet_method: UpdateURLs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
updateURLs creates the urls map with the content of the config's URLs array
and the given array that we get from the INFO protocol.


name: gatewayCfg.saveTLSHostname
go_file: server/gateway.go
go_class: gatewayCfg
go_method: saveTLSHostname
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayCfg
dotnet_method: SaveTLSHostname
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Saves the hostname of the given URL (if not already done).
This may be used as the ServerName of the TLSConfig when initiating a
TLS connection.
Write lock held on entry.


name: gatewayCfg.addURLs
go_file: server/gateway.go
go_class: gatewayCfg
go_method: addURLs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayCfg
dotnet_method: AddURLs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
add URLs from the given array to the urls map only if not already present.
remoteGateway write lock is assumed to be held on entry.
Write lock is held on entry.


name: Server.addGatewayURL
go_file: server/gateway.go
go_class: Server
go_method: addGatewayURL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AddGatewayURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Adds this URL to the set of Gateway URLs.
Returns true if the URL has been added, false otherwise.
Server lock held on entry


name: Server.removeGatewayURL
go_file: server/gateway.go
go_class: Server
go_method: removeGatewayURL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RemoveGatewayURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Removes this URL from the set of gateway URLs.
Returns true if the URL has been removed, false otherwise.
Server lock held on entry


name: Server.getGatewayURL
go_file: server/gateway.go
go_class: Server
go_method: getGatewayURL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetGatewayURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This returns the URL of the Gateway listen spec, or empty string
if the server has no gateway configured.


name: Server.registerInboundGatewayConnection
go_file: server/gateway.go
go_class: Server
go_method: registerInboundGatewayConnection
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RegisterInboundGatewayConnection
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Register the given gateway connection (*client) in the inbound gateways
map. The key is the connection ID (like for clients and routes).


name: Server.registerOutboundGatewayConnection
go_file: server/gateway.go
go_class: Server
go_method: registerOutboundGatewayConnection
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RegisterOutboundGatewayConnection
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Register the given gateway connection (*client) in the outbound gateways
map with the given name as the key.


name: Server.getOutboundGatewayConnections
go_file: server/gateway.go
go_class: Server
go_method: getOutboundGatewayConnections
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetOutboundGatewayConnections
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns all outbound gateway connections in the provided array.
The order of the gateways is suited for the sending of a message.
Current ordering is based on individual gateway's RTT value.


name: srvGateway.orderOutboundConnectionsLocked
go_file: server/gateway.go
go_class: srvGateway
go_method: orderOutboundConnectionsLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SrvGateway
dotnet_method: OrderOutboundConnectionsLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Orders the array of outbound connections.
Current ordering is by lowest RTT.
Gateway write lock is held on entry


name: Server.removeRemoteGatewayConnection
go_file: server/gateway.go
go_class: Server
go_method: removeRemoteGatewayConnection
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RemoveRemoteGatewayConnection
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
This is invoked when a gateway connection is closed and the server
is removing this connection from its state.


name: client.processGatewayAccountUnsub
go_file: server/gateway.go
go_class: client
go_method: processGatewayAccountUnsub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessGatewayAccountUnsub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
A- protocol received from the remote after sending messages
on an account that it has no interest in. Mark this account
with a "no interest" marker to prevent further messages send.
<Invoked from outbound connection's readLoop>


name: client.processGatewayAccountSub
go_file: server/gateway.go
go_class: client
go_method: processGatewayAccountSub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessGatewayAccountSub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
A+ protocol received from remote gateway if it had previously
sent an A-. Clear the "no interest" marker for this account.
<Invoked from outbound connection's readLoop>


name: client.processGatewayRUnsub
go_file: server/gateway.go
go_class: client
go_method: processGatewayRUnsub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessGatewayRUnsub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
RS- protocol received from the remote after sending messages
on a subject that it has no interest in (but knows about the
account). Mark this subject with a "no interest" marker to
prevent further messages being sent.
If in modeInterestOnly or for a queue sub, remove from
the sublist if present.
<Invoked from outbound connection's readLoop>


name: client.processGatewayRSub
go_file: server/gateway.go
go_class: client
go_method: processGatewayRSub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessGatewayRSub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
For plain subs, RS+ protocol received from remote gateway if it
had previously sent a RS-. Clear the "no interest" marker for
this subject (under this account).
For queue subs, or if in modeInterestOnly, register interest
from remote gateway.
<Invoked from outbound connection's readLoop>


name: client.gatewayInterest
go_file: server/gateway.go
go_class: client
go_method: gatewayInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GatewayInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns true if this gateway has possible interest in the
given account/subject (which means, it does not have a registered
no-interest on the account and/or subject) and the sublist result
for queue subscriptions.
<Outbound connection: invoked when client message is published,
so from any client connection's readLoop>


name: Server.maybeSendSubOrUnsubToGateways
go_file: server/gateway.go
go_class: Server
go_method: maybeSendSubOrUnsubToGateways
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MaybeSendSubOrUnsubToGateways
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is invoked when registering (or unregistering) the first
(or last) subscription on a given account/subject. For each
GWs inbound connections, we will check if we need to send an RS+ or A+
protocol.


name: Server.sendQueueSubOrUnsubToGateways
go_file: server/gateway.go
go_class: Server
go_method: sendQueueSubOrUnsubToGateways
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendQueueSubOrUnsubToGateways
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is invoked when the first (or last) queue subscription on a
given subject/group is registered (or unregistered). Sent to all
inbound gateways.


name: Server.gatewayUpdateSubInterest
go_file: server/gateway.go
go_class: Server
go_method: gatewayUpdateSubInterest
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GatewayUpdateSubInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
This is invoked when a subscription (plain or queue) is
added/removed locally or in our cluster. We use ref counting
to know when to update the inbound gateways.
<Invoked from client or route connection's readLoop or when such
connection is closed>


name: isGWRoutedReply
go_file: server/gateway.go
go_method: isGWRoutedReply
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayHandler
dotnet_method: IsGWRoutedReply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if the given subject is a GW routed reply subject,
that is, starts with $GNR and is long enough to contain cluster/server hash
and subject.


name: isGWRoutedSubjectAndIsOldPrefix
go_file: server/gateway.go
go_method: isGWRoutedSubjectAndIsOldPrefix
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayHandler
dotnet_method: IsGWRoutedSubjectAndIsOldPrefix
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Same than isGWRoutedReply but accepts the old prefix $GR and returns
a boolean indicating if this is the old prefix


name: hasGWRoutedReplyPrefix
go_file: server/gateway.go
go_method: hasGWRoutedReplyPrefix
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: GatewayHandler
dotnet_method: HasGWRoutedReplyPrefix
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if subject starts with "$GNR.". This is to check that
clients can't publish on this subject.


name: client.sendMsgToGateways
go_file: server/gateway.go
go_class: client
go_method: sendMsgToGateways
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendMsgToGateways
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
May send a message to all outbound gateways. It is possible
that the message is not sent to a given gateway if for instance
it is known that this gateway has no interest in the account or
subject, etc..
When invoked from a LEAF connection, `checkLeafQF` should be passed as `true`
so that we skip any queue subscription interest that is not part of the
`c.pa.queues` filter (similar to what we do in `processMsgResults`). However,
when processing service imports, then this boolean should be passes as `false`,
regardless if it is a LEAF connection or not.
<Invoked from any client connection's readLoop>


name: Server.gatewayHandleAccountNoInterest
go_file: server/gateway.go
go_class: Server
go_method: gatewayHandleAccountNoInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GatewayHandleAccountNoInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Possibly sends an A- to the remote gateway `c`.
Invoked when processing an inbound message and the account is not found.
A check under a lock that protects processing of SUBs and UNSUBs is
done to make sure that we don't send the A- if a subscription has just
been created at the same time, which would otherwise results in the
remote never sending messages on this account until a new subscription
is created.


name: client.sendAccountUnsubToGateway
go_file: server/gateway.go
go_class: client
go_method: sendAccountUnsubToGateway
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendAccountUnsubToGateway
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Helper that sends an A- to this remote gateway if not already done.
This function should not be invoked directly but instead be invoked
by functions holding the gateway.pasi's Lock.


name: Server.gatewayHandleSubjectNoInterest
go_file: server/gateway.go
go_class: Server
go_method: gatewayHandleSubjectNoInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GatewayHandleSubjectNoInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Possibly sends an A- for this account or RS- for this subject.
Invoked when processing an inbound message and the account is found
but there is no interest on this subject.
A test is done under a lock that protects processing of SUBs and UNSUBs
and if there is no subscription at this time, we send an A-. If there
is at least a subscription, but no interest on this subject, we send
an RS- for this subject (if not already done).


name: Server.storeRouteByHash
go_file: server/gateway.go
go_class: Server
go_method: storeRouteByHash
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StoreRouteByHash
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Store this route in map with the key being the remote server's name hash
and the remote server's ID hash used by gateway replies mapping routing.


name: client.handleGatewayReply
go_file: server/gateway.go
go_class: client
go_method: handleGatewayReply
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: HandleGatewayReply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This should be invoked only from processInboundGatewayMsg() or
processInboundRoutedMsg() and is checking if the subject
(c.pa.subject) has the _GR_ prefix. If so, this is processed
as a GW reply and `true` is returned to indicate to the caller
that it should stop processing.
If gateway is not enabled on this server or if the subject
does not start with _GR_, `false` is returned and caller should
process message as usual.


name: client.processInboundGatewayMsg
go_file: server/gateway.go
go_class: client
go_method: processInboundGatewayMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessInboundGatewayMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process a message coming from a remote gateway. Send to any sub/qsub
in our cluster that is matching. When receiving a message for an
account or subject for which there is no interest in this cluster
an A-/RS- protocol may be send back.
<Invoked from inbound connection's readLoop>


name: client.gatewayAllSubsReceiveStart
go_file: server/gateway.go
go_class: client
go_method: gatewayAllSubsReceiveStart
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GatewayAllSubsReceiveStart
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Indicates that the remote which we are sending messages to
has decided to send us all its subs interest so that we
stop doing optimistic sends.
<Invoked from outbound connection's readLoop>


name: client.gatewayAllSubsReceiveComplete
go_file: server/gateway.go
go_class: client
go_method: gatewayAllSubsReceiveComplete
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GatewayAllSubsReceiveComplete
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Indicates that the remote has finished sending all its
subscriptions and we should now not send unless we know
there is explicit interest.
<Invoked from outbound connection's readLoop>


name: client.gatewaySwitchAccountToSendAllSubs
go_file: server/gateway.go
go_class: client
go_method: gatewaySwitchAccountToSendAllSubs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GatewaySwitchAccountToSendAllSubs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Switch to send-all-subs mode for the given gateway and account.
This is invoked when processing an inbound message and we
reach a point where we had to send a lot of RS- for this
account. We will send an INFO protocol to indicate that we
start sending all our subs (for this account), followed by
all subs (RS+) and finally an INFO to indicate the end of it.
The remote will then send messages only if it finds explicit
interest in the sublist created based on all RS+ that we just
sent.
The client's lock is held on entry.
<Invoked from inbound connection's readLoop>


name: Server.trackGWReply
go_file: server/gateway.go
go_class: Server
go_method: trackGWReply
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: TrackGWReply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Keeps track of the routed reply to be used when/if application sends back a
message on the reply without the prefix.
If `client` is not nil, it will be stored in the client gwReplyMapping structure,
and client lock is held on entry.
If `client` is nil, the mapping is stored in the client's account's gwReplyMapping
structure. Account lock will be explicitly acquired.
This is a server receiver because we use a timer interval that is avail in
Server.gateway object.


name: ipqSizeCalculation
go_file: server/ipqueue.go
go_method: ipqSizeCalculation
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: IpqSizeCalculation
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
This option enables total queue size counting by passing in a function
that evaluates the size of each entry as it is pushed/popped. This option
enables the size() function.


name: ipqLimitBySize
go_file: server/ipqueue.go
go_method: ipqLimitBySize
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: IpqLimitBySize
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
This option allows setting the maximum queue size. Once the limit is
reached, then push() will stop returning true and no more entries will
be stored until some more are popped. The ipQueue_SizeCalculation must
be provided for this to work.


name: ipqLimitByLen
go_file: server/ipqueue.go
go_method: ipqLimitByLen
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: IpqLimitByLen
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
This option allows setting the maximum queue length. Once the limit is
reached, then push() will stop returning true and no more entries will
be stored until some more are popped.


name: .push
go_file: server/ipqueue.go
go_method: push
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: Push
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Add the element `e` to the queue, notifying the queue channel's `ch` if the
entry is the first to be added, and returns the length of the queue after
this element is added.


name: .pop
go_file: server/ipqueue.go
go_method: pop
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: Pop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the whole list of elements currently present in the queue,
emptying the queue. This should be called after receiving a notification
from the queue's `ch` notification channel that indicates that there
is something in the queue.
However, in cases where `drain()` may be called from another go
routine, it is possible that a routine is notified that there is
something, but by the time it calls `pop()`, the drain() would have
emptied the queue. So the caller should never assume that pop() will
return a slice of 1 or more, it could return `nil`.


name: .popOne
go_file: server/ipqueue.go
go_method: popOne
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: PopOne
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the first element from the queue, if any. See comment above
regarding calling after being notified that there is something and
the use of drain(). In short, the caller should always check the
boolean return value to ensure that the value is genuine and not a
default empty value.


name: .recycle
go_file: server/ipqueue.go
go_method: recycle
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: Recycle
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
After a pop(), the slice can be recycled for the next push() when
a first element is added to the queue.
This will also decrement the "in progress" count with the length
of the slice.
WARNING: The caller MUST never reuse `elts`.


name: .size
go_file: server/ipqueue.go
go_method: size
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: Size
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the calculated size of the queue (if ipQueue_SizeCalculation has been
passed in), otherwise returns zero.


name: .drain
go_file: server/ipqueue.go
go_method: drain
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: Drain
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Empty the queue and consumes the notification signal if present.
Returns the number of items that were drained from the queue.
Note that this could cause a reader go routine that has been
notified that there is something in the queue (reading from queue's `ch`)
may then get nothing if `drain()` is invoked before the `pop()` or `popOne()`.


name: .inProgress
go_file: server/ipqueue.go
go_method: inProgress
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: InProgress
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Since the length of the queue goes to 0 after a pop(), it is good to
have an insight on how many elements are yet to be processed after a pop().
For that reason, the queue maintains a count of elements returned through
the pop() API. When the caller will call q.recycle(), this count will
be reduced by the size of the slice returned by pop().


name: .unregister
go_file: server/ipqueue.go
go_method: unregister
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IpQueue
dotnet_method: Unregister
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Remove this queue from the server's map of ipQueues.
All ipQueue operations (such as push/pop/etc..) are still possible.


name: Server.EnableJetStream
go_file: server/jetstream.go
go_class: Server
go_method: EnableJetStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: EnableJetStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
EnableJetStream will enable JetStream support on this server with the given configuration.
A nil configuration will dynamically choose the limits and temporary file storage directory.


name: Server.checkStoreDir
go_file: server/jetstream.go
go_class: Server
go_method: checkStoreDir
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CheckStoreDir
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check to make sure directory has the jetstream directory.
We will have it properly configured here now regardless, so need to look inside.


name: Server.initJetStreamEncryption
go_file: server/jetstream.go
go_class: Server
go_method: initJetStreamEncryption
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InitJetStreamEncryption
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This function sets/updates the jetstream encryption key and cipher based
on options. If the TPM options have been specified, a key is generated
and sealed by the TPM.


name: Server.canExtendOtherDomain
go_file: server/jetstream.go
go_class: Server
go_method: canExtendOtherDomain
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CanExtendOtherDomain
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will check if we have a solicited leafnode that shares the system account
and extension is not manually disabled


name: Server.restartJetStream
go_file: server/jetstream.go
go_class: Server
go_method: restartJetStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RestartJetStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
restartJetStream will try to re-enable JetStream during a reload if it had been disabled during runtime.


name: Server.checkJetStreamExports
go_file: server/jetstream.go
go_class: Server
go_method: checkJetStreamExports
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CheckJetStreamExports
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
checkJetStreamExports will check if we have the JS exports setup
on the system account, and if not go ahead and set them up.


name: Server.DisableJetStream
go_file: server/jetstream.go
go_class: Server
go_method: DisableJetStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: DisableJetStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
DisableJetStream will turn off JetStream and signals in clustered mode
to have the metacontroller remove us from the peer list.


name: Account.enableAllJetStreamServiceImportsAndMappings
go_file: server/jetstream.go
go_class: Account
go_method: enableAllJetStreamServiceImportsAndMappings
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: EnableAllJetStreamServiceImportsAndMappings
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
enableAllJetStreamServiceImportsAndMappings turns on all service imports and mappings for jetstream for this account.


name: Account.enableJetStreamInfoServiceImportOnly
go_file: server/jetstream.go
go_class: Account
go_method: enableJetStreamInfoServiceImportOnly
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: EnableJetStreamInfoServiceImportOnly
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
enableJetStreamInfoServiceImportOnly will enable the single service import responder.
Should we do them all regardless?


name: Server.JetStreamConfig
go_file: server/jetstream.go
go_class: Server
go_method: JetStreamConfig
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: JetStreamConfig
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
JetStreamConfig will return the current config. Useful if the system
created a dynamic configuration. A copy is returned.


name: Account.EnableJetStream
go_file: server/jetstream.go
go_class: Account
go_method: EnableJetStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: EnableJetStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
EnableJetStream will enable JetStream on this account with the defined limits.
This is a helper for JetStreamEnableAccount.


name: Account.maxBytesLimits
go_file: server/jetstream.go
go_class: Account
go_method: maxBytesLimits
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: MaxBytesLimits
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Return whether we require MaxBytes to be set and if > 0 an upper limit for stream size exists
Both limits are independent of each other.


name: jsAccount.reservedStorage
go_file: server/jetstream.go
go_class: jsAccount
go_method: reservedStorage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsAccount
dotnet_method: ReservedStorage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Return reserved bytes for memory and file store streams for this account on this server.
Lock should be held.


name: reservedStorage
go_file: server/jetstream.go
go_method: reservedStorage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: ReservedStorage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Return reserved bytes for memory and file store streams for this account in clustered mode.
js lock should be held.


name: Account.jetStreamConfigured
go_file: server/jetstream.go
go_class: Account
go_method: jetStreamConfigured
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: JetStreamConfigured
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
jetStreamConfigured reports whether the account has JetStream configured, regardless of this
servers JetStream status.


name: jsAccount.checkAndSyncUsage
go_file: server/jetstream.go
go_class: jsAccount
go_method: checkAndSyncUsage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsAccount
dotnet_method: CheckAndSyncUsage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
When we detect a skew of some sort this will verify the usage reporting is correct.
No locks should be held.


name: jsAccount.updateUsage
go_file: server/jetstream.go
go_class: jsAccount
go_method: updateUsage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsAccount
dotnet_method: UpdateUsage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Updates accounting on in use memory and storage. This is called from locally
by the lower storage layers.


name: jetStream.checkBytesLimits
go_file: server/jetstream.go
go_class: jetStream
go_method: checkBytesLimits
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: CheckBytesLimits
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check if additional bytes will exceed our account limits and optionally the server itself.
Read Lock should be held.


name: friendlyBytes
go_file: server/jetstream.go
go_method: friendlyBytes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: FriendlyBytes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
friendlyBytes returns a string with the given bytes int64
represented as a size, such as 1KB, 10MB, etc...


name: ApiResponse.ToError
go_file: server/jetstream_api.go
go_class: ApiResponse
go_method: ToError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ApiResponse
dotnet_method: ToError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ToError checks if the response has a error and if it does converts it to an error avoiding
the pitfalls described by https://yourbasic.org/golang/gotcha-why-nil-error-not-equal-nil/


name: Account.checkJetStream
go_file: server/jetstream_api.go
go_class: Account
go_method: checkJetStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: CheckJetStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper function to check on JetStream being enabled but also on status of leafnodes
If the local account is not enabled but does have leafnode connectivity we will not
want to error immediately and let the other side decide.


name: Server.jsLeaderStepDownRequest
go_file: server/jetstream_api.go
go_class: Server
go_method: jsLeaderStepDownRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: JsLeaderStepDownRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Request to have the meta leader stepdown.
These will only be received by the meta leader, so less checking needed.


name: isJSONObjectOrArray
go_file: server/jetstream_api.go
go_method: isJSONObjectOrArray
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamApi
dotnet_method: IsJSONObjectOrArray
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check if given []bytes is a JSON Object or Array.
Technically, valid JSON can also be a plain string or number, but for our use case,
we care only for JSON objects or arrays which starts with `[` or `{`.
This function does not have to ensure valid JSON in its entirety. It is used merely
to hint the codepath if it should attempt to parse the request as JSON or not.


name: Server.getStepDownPreferredPlacement
go_file: server/jetstream_api.go
go_class: Server
go_method: getStepDownPreferredPlacement
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetStepDownPreferredPlacement
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
getStepDownPreferredPlacement attempts to work out what the best placement is
for a stepdown request. The preferred server name always takes precedence, but
if not specified, the placement will be used to filter by cluster. The caller
should check for return API errors and return those to the requestor if needed.


name: Server.jsConsumerCreateRequest
go_file: server/jetstream_api.go
go_class: Server
go_method: jsConsumerCreateRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: JsConsumerCreateRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Request to create a consumer where stream and optional consumer name are part of the subject, and optional
filtered subjects can be at the tail end.
Assumes stream and consumer names are single tokens.


name: batchGroup.readyForCommit
go_file: server/jetstream_batching.go
go_class: batchGroup
go_method: readyForCommit
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamBatching
dotnet_method: ReadyForCommit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
readyForCommit indicates the batch is ready to be committed.
If the timer has already cleaned up the batch, we can't commit.
Otherwise, we ensure the timer does not clean up the batch in the meantime.
Lock should be held.


name: batchGroup.cleanup
go_file: server/jetstream_batching.go
go_class: batchGroup
go_method: cleanup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamBatching
dotnet_method: Cleanup
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
cleanup deletes underlying resources associated with the batch and unregisters it from the stream's batches.


name: batchApply.rejectBatchStateLocked
go_file: server/jetstream_batching.go
go_class: batchApply
go_method: rejectBatchStateLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamBatching
dotnet_method: RejectBatchStateLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
rejectBatchStateLocked rejects the batch and clears in-memory apply-batch-related state.
Corrects mset.clfs to take the failed batch into account.
batch.mu lock should be held.


name: checkMsgHeadersPreClusteredProposal
go_file: server/jetstream_batching.go
go_method: checkMsgHeadersPreClusteredProposal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamBatching
dotnet_method: CheckMsgHeadersPreClusteredProposal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
checkMsgHeadersPreClusteredProposal checks the message for expected/consistency headers.
mset.mu lock must NOT be held or used.
mset.clMu lock must be held.


name: jetStreamCluster.isStreamCurrent
go_file: server/jetstream_cluster.go
go_class: jetStreamCluster
go_method: isStreamCurrent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamCluster
dotnet_method: IsStreamCurrent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isStreamCurrent will determine if the stream is up to date.
For R1 it will make sure the stream is present on this server.
Read lock should be held.


name: jetStream.isStreamHealthy
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: isStreamHealthy
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: IsStreamHealthy
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isStreamHealthy will determine if the stream is up to date or very close.
For R1 it will make sure the stream is present on this server.


name: jetStream.isConsumerHealthy
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: isConsumerHealthy
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: IsConsumerHealthy
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isConsumerHealthy will determine if the consumer is up to date.
For R1 it will make sure the consunmer is present on this server.


name: jetStream.subjectsOverlap
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: subjectsOverlap
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: SubjectsOverlap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
subjectsOverlap checks all existing stream assignments for the account cross-cluster for subject overlap
Use only for clustered JetStream
Read lock should be held.


name: jetStream.isClusteredNoLock
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: isClusteredNoLock
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: IsClusteredNoLock
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isClusteredNoLock returns if we are clustered, but unlike isClustered() does
not use the jetstream's lock, instead, uses an atomic operation.
There are situations where some code wants to know if we are clustered but
can't use js.isClustered() without causing a lock inversion.


name: jetStreamCluster.trackInflightStreamProposal
go_file: server/jetstream_cluster.go
go_class: jetStreamCluster
go_method: trackInflightStreamProposal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamCluster
dotnet_method: TrackInflightStreamProposal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Track the stream for the account `accName` in the inflight proposals map.
This is done after proposing a stream change.
(Write) Lock held on entry.


name: jetStreamCluster.removeInflightStreamProposal
go_file: server/jetstream_cluster.go
go_class: jetStreamCluster
go_method: removeInflightStreamProposal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamCluster
dotnet_method: RemoveInflightStreamProposal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Remove the stream `streamName` for the account `accName` from the inflight proposals map.
This is done after successful create/update/delete.
(Write) Lock held on entry.


name: jetStreamCluster.trackInflightConsumerProposal
go_file: server/jetstream_cluster.go
go_class: jetStreamCluster
go_method: trackInflightConsumerProposal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamCluster
dotnet_method: TrackInflightConsumerProposal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Track the consumer for the `streamName` and account `accName` in the inflight proposals map.
This is done after proposing a consumer change.
(Write) Lock held on entry.


name: jetStreamCluster.removeInflightConsumerProposal
go_file: server/jetstream_cluster.go
go_class: jetStreamCluster
go_method: removeInflightConsumerProposal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamCluster
dotnet_method: RemoveInflightConsumerProposal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Remove the consumer `consumerName` for the `streamName` and account `accName` from the inflight proposals map.
This is done after successful create/update/delete.
(Write) Lock held on entry.


name: jetStream.checkForOrphans
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: checkForOrphans
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: CheckForOrphans
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Called after recovery of the cluster on startup to check for any orphans.
Streams and consumers are recovered from disk, and the meta layer's mappings
should clean them up, but under crash scenarios there could be orphans.


name: jetStream.getOrphans
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: getOrphans
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: GetOrphans
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns orphaned streams and consumers that were recovered from disk, but don't
exist as clustered stream/consumer assignments.
Lock should be held.


name: jetStream.encodeMetaSnapshot
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: encodeMetaSnapshot
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: EncodeMetaSnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Encode the meta assignments into an encoded and compressed buffer.
Returns the snapshot itself, and the amount of streams and consumers.


name: jetStream.processAddPeer
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: processAddPeer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: ProcessAddPeer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Called when we detect a new peer. Only the leader will process checking
for any streams, and consequently any consumers.


name: stream.waitOnConsumerAssignments
go_file: server/jetstream_cluster.go
go_class: stream
go_method: waitOnConsumerAssignments
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: WaitOnConsumerAssignments
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will wait for a period of time until all consumers are registered and have
their consumer assignments assigned.
Should only be called from monitorStream.


name: stream.resetClusteredState
go_file: server/jetstream_cluster.go
go_class: stream
go_method: resetClusteredState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: ResetClusteredState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
resetClusteredState is called when a clustered stream had an error (e.g sequence mismatch, bad snapshot) and needs to be reset.


name: jetStream.applyStreamEntries
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: applyStreamEntries
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: ApplyStreamEntries
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Apply our stream entries.
Return maximum allowed applied value, if currently inside a batch, zero otherwise.


name: stream.skipBatchIfRecovering
go_file: server/jetstream_cluster.go
go_class: stream
go_method: skipBatchIfRecovering
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: SkipBatchIfRecovering
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
skipBatchIfRecovering returns whether the batched message can be skipped because the batch was already fully applied.
Stream and batch.mu locks should be held.


name: Server.replicas
go_file: server/jetstream_cluster.go
go_class: Server
go_method: replicas
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: Replicas
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the PeerInfo for all replicas of a raft node. This is different than node.Peers()
and is used for external facing advisories.


name: jetStream.streamAssignmentsOrInflightSeq
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: streamAssignmentsOrInflightSeq
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: StreamAssignmentsOrInflightSeq
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will gather all stream assignments for a specific account, both applied and inflight assignments.
Lock should be held.


name: jetStream.streamAssignmentsOrInflightSeqAllAccounts
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: streamAssignmentsOrInflightSeqAllAccounts
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: StreamAssignmentsOrInflightSeqAllAccounts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will gather all stream assignments for all accounts, both applied and inflight assignments.
Lock should be held.


name: jetStream.processClusterUpdateStream
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: processClusterUpdateStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: ProcessClusterUpdateStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
processClusterUpdateStream is called when we have a stream assignment that
has been updated for an existing assignment and we are a member.


name: jetStream.processClusterCreateStream
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: processClusterCreateStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: ProcessClusterCreateStream
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
processClusterCreateStream is called when we have a stream assignment that
has been committed and this server is a member of the peer group.


name: jetStream.consumerAssignmentsOrInflightSeq
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: consumerAssignmentsOrInflightSeq
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: ConsumerAssignmentsOrInflightSeq
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will gather all consumer assignments for the specified account and stream, both applied and inflight assignments.
Lock should be held.


name: consumer.replica
go_file: server/jetstream_cluster.go
go_class: consumer
go_method: replica
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsConsumer
dotnet_method: Replica
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Return the replica count for this consumer. If the consumer has been
stopped, this will return an error.


name: jetStreamCluster.selectPeerGroup
go_file: server/jetstream_cluster.go
go_class: jetStreamCluster
go_method: selectPeerGroup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamCluster
dotnet_method: SelectPeerGroup
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
selectPeerGroup will select a group of peers to start a raft group.
when peers exist already the unique tag prefix check for the replaceFirstExisting will be skipped
js lock should be held.


name: jetStream.tieredStreamAndReservationCount
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: tieredStreamAndReservationCount
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: TieredStreamAndReservationCount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
returns stream count for this tier as well as applicable reservation size (not including cfg)
jetStream read lock should be held


name: Server.jsClusteredStreamListRequest
go_file: server/jetstream_cluster.go
go_class: Server
go_method: jsClusteredStreamListRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: JsClusteredStreamListRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will do a scatter and gather operation for all streams for this account. This is only called from metadata leader.
This will be running in a separate Go routine.


name: Server.jsClusteredConsumerListRequest
go_file: server/jetstream_cluster.go
go_class: Server
go_method: jsClusteredConsumerListRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: JsClusteredConsumerListRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will do a scatter and gather operation for all consumers for this stream and account.
This will be running in a separate Go routine.


name: stream.calculateSyncRequest
go_file: server/jetstream_cluster.go
go_class: stream
go_method: calculateSyncRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: CalculateSyncRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Given a stream state that represents a snapshot, calculate the sync request based on our current state.
Stream lock must be held.


name: stream.processSnapshotDeletes
go_file: server/jetstream_cluster.go
go_class: stream
go_method: processSnapshotDeletes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: ProcessSnapshotDeletes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
processSnapshotDeletes will update our current store based on the snapshot
but only processing deletes and new FirstSeq / purges.


name: stream.flushAllPending
go_file: server/jetstream_cluster.go
go_class: stream
go_method: flushAllPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: FlushAllPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
flushAllPending will flush any pending writes as a result of installing a snapshot or performing catchup.


name: jetStream.streamAlternates
go_file: server/jetstream_cluster.go
go_class: jetStream
go_method: streamAlternates
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEngine
dotnet_method: StreamAlternates
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Return a list of alternates, ranked by preference order to the request, of stream mirrors.
This allows clients to select or get more information about read replicas that could be a
better option to connect to versus the original source.


name: Server.gcbAdd
go_file: server/jetstream_cluster.go
go_class: Server
go_method: gcbAdd
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GcbAdd
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Adds `sz` to the server's total outstanding catchup bytes and to `localsz`
under the gcbMu lock. The `localsz` points to the local outstanding catchup
bytes of the runCatchup go routine of a given stream.


name: Server.gcbSubLocked
go_file: server/jetstream_cluster.go
go_class: Server
go_method: gcbSubLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GcbSubLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Removes `sz` from the server's total outstanding catchup bytes and from
`localsz`, but only if `localsz` is non 0, which would signal that gcSubLast
has already been invoked. See that function for details.
Must be invoked under the gcbMu lock.


name: Server.gcbSubLast
go_file: server/jetstream_cluster.go
go_class: Server
go_method: gcbSubLast
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GcbSubLast
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Similar to gcbSub() but reset `localsz` to 0 at the end under the gcbMu lock.
This will signal further calls to gcbSub() for this `localsz` pointer that
nothing should be done because runCatchup() has exited and any remaining
outstanding bytes value has already been decremented.


name: Unless
go_file: server/jetstream_errors.go
go_method: Unless
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: Unless
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
Unless ensures that if err is a ApiErr that err will be returned rather than the one being created via the helper


name: IsNatsErr
go_file: server/jetstream_errors.go
go_method: IsNatsErr
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: IsNatsErr
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:32:09
description:
IsNatsErr determines if an error matches ID, if multiple IDs are given if the error matches any of these the function will be true


name: NewJSAccountResourcesExceededError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAccountResourcesExceededError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAccountResourcesExceededError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAccountResourcesExceededError creates a new JSAccountResourcesExceededErr error: "resource limits exceeded for account"


name: NewJSAtomicPublishContainsDuplicateMessageError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishContainsDuplicateMessageError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishContainsDuplicateMessageError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishContainsDuplicateMessageError creates a new JSAtomicPublishContainsDuplicateMessageErr error: "atomic publish batch contains duplicate message id"


name: NewJSAtomicPublishDisabledError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishDisabledError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishDisabledError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishDisabledError creates a new JSAtomicPublishDisabledErr error: "atomic publish is disabled"


name: NewJSAtomicPublishIncompleteBatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishIncompleteBatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishIncompleteBatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishIncompleteBatchError creates a new JSAtomicPublishIncompleteBatchErr error: "atomic publish batch is incomplete"


name: NewJSAtomicPublishInvalidBatchCommitError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishInvalidBatchCommitError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishInvalidBatchCommitError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishInvalidBatchCommitError creates a new JSAtomicPublishInvalidBatchCommitErr error: "atomic publish batch commit is invalid"


name: NewJSAtomicPublishInvalidBatchIDError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishInvalidBatchIDError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishInvalidBatchIDError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishInvalidBatchIDError creates a new JSAtomicPublishInvalidBatchIDErr error: "atomic publish batch ID is invalid"


name: NewJSAtomicPublishMissingSeqError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishMissingSeqError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishMissingSeqError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishMissingSeqError creates a new JSAtomicPublishMissingSeqErr error: "atomic publish sequence is missing"


name: NewJSAtomicPublishTooLargeBatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishTooLargeBatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishTooLargeBatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishTooLargeBatchError creates a new JSAtomicPublishTooLargeBatchErrF error: "atomic publish batch is too large: {size}"


name: NewJSAtomicPublishUnsupportedHeaderBatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSAtomicPublishUnsupportedHeaderBatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSAtomicPublishUnsupportedHeaderBatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:53
description:
NewJSAtomicPublishUnsupportedHeaderBatchError creates a new JSAtomicPublishUnsupportedHeaderBatchErr error: "atomic publish unsupported header used: {header}"


name: NewJSClusterNotActiveError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterNotActiveError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterNotActiveError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:57
description:
NewJSClusterNotActiveError creates a new JSClusterNotActiveErr error: "JetStream not in clustered mode"


name: NewJSClusterNotAssignedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterNotAssignedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterNotAssignedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:57
description:
NewJSClusterNotAssignedError creates a new JSClusterNotAssignedErr error: "JetStream cluster not assigned to this server"


name: NewJSClusterNotAvailError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterNotAvailError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterNotAvailError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:57
description:
NewJSClusterNotAvailError creates a new JSClusterNotAvailErr error: "JetStream system temporarily unavailable"


name: NewJSClusterNotLeaderError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterNotLeaderError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterNotLeaderError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:24:57
description:
NewJSClusterNotLeaderError creates a new JSClusterNotLeaderErr error: "JetStream cluster can not handle request"


name: NewJSClusterRequiredError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterRequiredError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterRequiredError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSClusterRequiredError creates a new JSClusterRequiredErr error: "JetStream clustering support required"


name: NewJSClusterServerMemberChangeInflightError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterServerMemberChangeInflightError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterServerMemberChangeInflightError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSClusterServerMemberChangeInflightError creates a new JSClusterServerMemberChangeInflightErr error: "cluster member change is in progress"


name: NewJSClusterServerNotMemberError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterServerNotMemberError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterServerNotMemberError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSClusterServerNotMemberError creates a new JSClusterServerNotMemberErr error: "server is not a member of the cluster"


name: NewJSClusterTagsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterTagsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterTagsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSClusterTagsError creates a new JSClusterTagsErr error: "tags placement not supported for operation"


name: NewJSClusterUnSupportFeatureError
go_file: server/jetstream_errors_generated.go
go_method: NewJSClusterUnSupportFeatureError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSClusterUnSupportFeatureError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSClusterUnSupportFeatureError creates a new JSClusterUnSupportFeatureErr error: "not currently supported in clustered mode"


name: NewJSConsumerAckPolicyInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerAckPolicyInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerAckPolicyInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerAckPolicyInvalidError creates a new JSConsumerAckPolicyInvalidErr error: "consumer ack policy invalid"


name: NewJSConsumerAckWaitNegativeError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerAckWaitNegativeError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerAckWaitNegativeError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerAckWaitNegativeError creates a new JSConsumerAckWaitNegativeErr error: "consumer ack wait needs to be positive"


name: NewJSConsumerAlreadyExistsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerAlreadyExistsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerAlreadyExistsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerAlreadyExistsError creates a new JSConsumerAlreadyExists error: "consumer already exists"


name: NewJSConsumerBackOffNegativeError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerBackOffNegativeError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerBackOffNegativeError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerBackOffNegativeError creates a new JSConsumerBackOffNegativeErr error: "consumer backoff needs to be positive"


name: NewJSConsumerBadDurableNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerBadDurableNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerBadDurableNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerBadDurableNameError creates a new JSConsumerBadDurableNameErr error: "durable name can not contain '.', '*', '>'"


name: NewJSConsumerConfigRequiredError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerConfigRequiredError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerConfigRequiredError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerConfigRequiredError creates a new JSConsumerConfigRequiredErr error: "consumer config required"


name: NewJSConsumerCreateDurableAndNameMismatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerCreateDurableAndNameMismatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerCreateDurableAndNameMismatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerCreateDurableAndNameMismatchError creates a new JSConsumerCreateDurableAndNameMismatch error: "Consumer Durable and Name have to be equal if both are provided"


name: NewJSConsumerCreateFilterSubjectMismatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerCreateFilterSubjectMismatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerCreateFilterSubjectMismatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerCreateFilterSubjectMismatchError creates a new JSConsumerCreateFilterSubjectMismatchErr error: "Consumer create request did not match filtered subject from create subject"


name: NewJSConsumerDeliverCycleError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDeliverCycleError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDeliverCycleError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerDeliverCycleError creates a new JSConsumerDeliverCycleErr error: "consumer deliver subject forms a cycle"


name: NewJSConsumerDeliverToWildcardsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDeliverToWildcardsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDeliverToWildcardsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerDeliverToWildcardsError creates a new JSConsumerDeliverToWildcardsErr error: "consumer deliver subject has wildcards"


name: NewJSConsumerDescriptionTooLongError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDescriptionTooLongError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDescriptionTooLongError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerDescriptionTooLongError creates a new JSConsumerDescriptionTooLongErrF error: "consumer description is too long, maximum allowed is {max}"


name: NewJSConsumerDirectRequiresEphemeralError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDirectRequiresEphemeralError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDirectRequiresEphemeralError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerDirectRequiresEphemeralError creates a new JSConsumerDirectRequiresEphemeralErr error: "consumer direct requires an ephemeral consumer"


name: NewJSConsumerDirectRequiresPushError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDirectRequiresPushError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDirectRequiresPushError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerDirectRequiresPushError creates a new JSConsumerDirectRequiresPushErr error: "consumer direct requires a push based consumer"


name: NewJSConsumerDoesNotExistError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDoesNotExistError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDoesNotExistError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:28:31
description:
NewJSConsumerDoesNotExistError creates a new JSConsumerDoesNotExist error: "consumer does not exist"


name: NewJSConsumerDuplicateFilterSubjectsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDuplicateFilterSubjectsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDuplicateFilterSubjectsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerDuplicateFilterSubjectsError creates a new JSConsumerDuplicateFilterSubjects error: "consumer cannot have both FilterSubject and FilterSubjects specified"


name: NewJSConsumerDurableNameNotInSubjectError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDurableNameNotInSubjectError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDurableNameNotInSubjectError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerDurableNameNotInSubjectError creates a new JSConsumerDurableNameNotInSubjectErr error: "consumer expected to be durable but no durable name set in subject"


name: NewJSConsumerDurableNameNotMatchSubjectError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDurableNameNotMatchSubjectError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDurableNameNotMatchSubjectError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerDurableNameNotMatchSubjectError creates a new JSConsumerDurableNameNotMatchSubjectErr error: "consumer name in subject does not match durable name in request"


name: NewJSConsumerDurableNameNotSetError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerDurableNameNotSetError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerDurableNameNotSetError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerDurableNameNotSetError creates a new JSConsumerDurableNameNotSetErr error: "consumer expected to be durable but a durable name was not set"


name: NewJSConsumerEmptyFilterError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerEmptyFilterError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerEmptyFilterError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerEmptyFilterError creates a new JSConsumerEmptyFilter error: "consumer filter in FilterSubjects cannot be empty"


name: NewJSConsumerEmptyGroupNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerEmptyGroupNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerEmptyGroupNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerEmptyGroupNameError creates a new JSConsumerEmptyGroupName error: "Group name cannot be an empty string"


name: NewJSConsumerEphemeralWithDurableInSubjectError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerEphemeralWithDurableInSubjectError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerEphemeralWithDurableInSubjectError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerEphemeralWithDurableInSubjectError creates a new JSConsumerEphemeralWithDurableInSubjectErr error: "consumer expected to be ephemeral but detected a durable name set in subject"


name: NewJSConsumerEphemeralWithDurableNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerEphemeralWithDurableNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerEphemeralWithDurableNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerEphemeralWithDurableNameError creates a new JSConsumerEphemeralWithDurableNameErr error: "consumer expected to be ephemeral but a durable name was set in request"


name: NewJSConsumerExistingActiveError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerExistingActiveError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerExistingActiveError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerExistingActiveError creates a new JSConsumerExistingActiveErr error: "consumer already exists and is still active"


name: NewJSConsumerFCRequiresPushError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerFCRequiresPushError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerFCRequiresPushError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerFCRequiresPushError creates a new JSConsumerFCRequiresPushErr error: "consumer flow control requires a push based consumer"


name: NewJSConsumerFilterNotSubsetError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerFilterNotSubsetError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerFilterNotSubsetError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerFilterNotSubsetError creates a new JSConsumerFilterNotSubsetErr error: "consumer filter subject is not a valid subset of the interest subjects"


name: NewJSConsumerHBRequiresPushError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerHBRequiresPushError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerHBRequiresPushError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerHBRequiresPushError creates a new JSConsumerHBRequiresPushErr error: "consumer idle heartbeat requires a push based consumer"


name: NewJSConsumerInactiveThresholdExcessError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerInactiveThresholdExcessError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerInactiveThresholdExcessError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerInactiveThresholdExcessError creates a new JSConsumerInactiveThresholdExcess error: "consumer inactive threshold exceeds system limit of {limit}"


name: NewJSConsumerInvalidDeliverSubjectError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerInvalidDeliverSubjectError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerInvalidDeliverSubjectError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerInvalidDeliverSubjectError creates a new JSConsumerInvalidDeliverSubject error: "invalid push consumer deliver subject"


name: NewJSConsumerInvalidGroupNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerInvalidGroupNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerInvalidGroupNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerInvalidGroupNameError creates a new JSConsumerInvalidGroupNameErr error: "Valid priority group name must match A-Z, a-z, 0-9, -_/=)+ and may not exceed 16 characters"


name: NewJSConsumerInvalidPriorityGroupError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerInvalidPriorityGroupError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerInvalidPriorityGroupError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerInvalidPriorityGroupError creates a new JSConsumerInvalidPriorityGroupErr error: "Provided priority group does not exist for this consumer"


name: NewJSConsumerInvalidResetError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerInvalidResetError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerInvalidResetError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerInvalidResetError creates a new JSConsumerInvalidResetErr error: "invalid reset: {err}"


name: NewJSConsumerInvalidSamplingError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerInvalidSamplingError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerInvalidSamplingError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerInvalidSamplingError creates a new JSConsumerInvalidSamplingErrF error: "failed to parse consumer sampling configuration: {err}"


name: NewJSConsumerMaxDeliverBackoffError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxDeliverBackoffError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxDeliverBackoffError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:31:58
description:
NewJSConsumerMaxDeliverBackoffError creates a new JSConsumerMaxDeliverBackoffErr error: "max deliver is required to be > length of backoff values"


name: NewJSConsumerMaxPendingAckExcessError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxPendingAckExcessError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxPendingAckExcessError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMaxPendingAckExcessError creates a new JSConsumerMaxPendingAckExcessErrF error: "consumer max ack pending exceeds system limit of {limit}"


name: NewJSConsumerMaxPendingAckPolicyRequiredError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxPendingAckPolicyRequiredError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxPendingAckPolicyRequiredError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMaxPendingAckPolicyRequiredError creates a new JSConsumerMaxPendingAckPolicyRequiredErr error: "consumer requires ack policy for max ack pending"


name: NewJSConsumerMaxRequestBatchExceededError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxRequestBatchExceededError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxRequestBatchExceededError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMaxRequestBatchExceededError creates a new JSConsumerMaxRequestBatchExceededF error: "consumer max request batch exceeds server limit of {limit}"


name: NewJSConsumerMaxRequestBatchNegativeError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxRequestBatchNegativeError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxRequestBatchNegativeError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMaxRequestBatchNegativeError creates a new JSConsumerMaxRequestBatchNegativeErr error: "consumer max request batch needs to be > 0"


name: NewJSConsumerMaxRequestExpiresTooSmallError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxRequestExpiresTooSmallError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxRequestExpiresTooSmallError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMaxRequestExpiresTooSmallError creates a new JSConsumerMaxRequestExpiresTooSmall error: "consumer max request expires needs to be >= 1ms"


name: NewJSConsumerMaxWaitingNegativeError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMaxWaitingNegativeError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMaxWaitingNegativeError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMaxWaitingNegativeError creates a new JSConsumerMaxWaitingNegativeErr error: "consumer max waiting needs to be positive"


name: NewJSConsumerMetadataLengthError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMetadataLengthError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMetadataLengthError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMetadataLengthError creates a new JSConsumerMetadataLengthErrF error: "consumer metadata exceeds maximum size of {limit}"


name: NewJSConsumerMultipleFiltersNotAllowedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerMultipleFiltersNotAllowedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerMultipleFiltersNotAllowedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerMultipleFiltersNotAllowedError creates a new JSConsumerMultipleFiltersNotAllowed error: "consumer with multiple subject filters cannot use subject based API"


name: NewJSConsumerNameContainsPathSeparatorsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerNameContainsPathSeparatorsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerNameContainsPathSeparatorsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerNameContainsPathSeparatorsError creates a new JSConsumerNameContainsPathSeparatorsErr error: "Consumer name can not contain path separators"


name: NewJSConsumerNameExistError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerNameExistError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerNameExistError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerNameExistError creates a new JSConsumerNameExistErr error: "consumer name already in use"


name: NewJSConsumerNameTooLongError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerNameTooLongError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerNameTooLongError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerNameTooLongError creates a new JSConsumerNameTooLongErrF error: "consumer name is too long, maximum allowed is {max}"


name: NewJSConsumerOfflineReasonError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerOfflineReasonError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerOfflineReasonError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerOfflineReasonError creates a new JSConsumerOfflineReasonErrF error: "consumer is offline: {err}"


name: NewJSConsumerOnMappedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerOnMappedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerOnMappedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerOnMappedError creates a new JSConsumerOnMappedErr error: "consumer direct on a mapped consumer"


name: NewJSConsumerOverlappingSubjectFiltersError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerOverlappingSubjectFiltersError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerOverlappingSubjectFiltersError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerOverlappingSubjectFiltersError creates a new JSConsumerOverlappingSubjectFilters error: "consumer subject filters cannot overlap"


name: NewJSConsumerPinnedTTLWithoutPriorityPolicyNoneError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPinnedTTLWithoutPriorityPolicyNoneError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPinnedTTLWithoutPriorityPolicyNoneError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerPinnedTTLWithoutPriorityPolicyNoneError creates a new JSConsumerPinnedTTLWithoutPriorityPolicyNone error: "PinnedTTL cannot be set when PriorityPolicy is none"


name: NewJSConsumerPriorityGroupWithPolicyNoneError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPriorityGroupWithPolicyNoneError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPriorityGroupWithPolicyNoneError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerPriorityGroupWithPolicyNoneError creates a new JSConsumerPriorityGroupWithPolicyNone error: "consumer can not have priority groups when policy is none"


name: NewJSConsumerPriorityPolicyWithoutGroupError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPriorityPolicyWithoutGroupError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPriorityPolicyWithoutGroupError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerPriorityPolicyWithoutGroupError creates a new JSConsumerPriorityPolicyWithoutGroup error: "Setting PriorityPolicy requires at least one PriorityGroup to be set"


name: NewJSConsumerPullNotDurableError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPullNotDurableError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPullNotDurableError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:35:48
description:
NewJSConsumerPullNotDurableError creates a new JSConsumerPullNotDurableErr error: "consumer in pull mode requires a durable name"


name: NewJSConsumerPullRequiresAckError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPullRequiresAckError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPullRequiresAckError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerPullRequiresAckError creates a new JSConsumerPullRequiresAckErr error: "consumer in pull mode requires explicit ack policy on workqueue stream"


name: NewJSConsumerPullWithRateLimitError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPullWithRateLimitError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPullWithRateLimitError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerPullWithRateLimitError creates a new JSConsumerPullWithRateLimitErr error: "consumer in pull mode can not have rate limit set"


name: NewJSConsumerPushMaxWaitingError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPushMaxWaitingError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPushMaxWaitingError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerPushMaxWaitingError creates a new JSConsumerPushMaxWaitingErr error: "consumer in push mode can not set max waiting"


name: NewJSConsumerPushWithPriorityGroupError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerPushWithPriorityGroupError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerPushWithPriorityGroupError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerPushWithPriorityGroupError creates a new JSConsumerPushWithPriorityGroupErr error: "priority groups can not be used with push consumers"


name: NewJSConsumerReplacementWithDifferentNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerReplacementWithDifferentNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerReplacementWithDifferentNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerReplacementWithDifferentNameError creates a new JSConsumerReplacementWithDifferentNameErr error: "consumer replacement durable config not the same"


name: NewJSConsumerReplayPolicyInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerReplayPolicyInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerReplayPolicyInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerReplayPolicyInvalidError creates a new JSConsumerReplayPolicyInvalidErr error: "consumer replay policy invalid"


name: NewJSConsumerReplicasExceedsStreamError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerReplicasExceedsStreamError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerReplicasExceedsStreamError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerReplicasExceedsStreamError creates a new JSConsumerReplicasExceedsStream error: "consumer config replica count exceeds parent stream"


name: NewJSConsumerReplicasShouldMatchStreamError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerReplicasShouldMatchStreamError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerReplicasShouldMatchStreamError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerReplicasShouldMatchStreamError creates a new JSConsumerReplicasShouldMatchStream error: "consumer config replicas must match interest retention stream's replicas"


name: NewJSConsumerSmallHeartbeatError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerSmallHeartbeatError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerSmallHeartbeatError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerSmallHeartbeatError creates a new JSConsumerSmallHeartbeatErr error: "consumer idle heartbeat needs to be >= 100ms"


name: NewJSConsumerStoreFailedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerStoreFailedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerStoreFailedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerStoreFailedError creates a new JSConsumerStoreFailedErrF error: "error creating store for consumer: {err}"


name: NewJSConsumerWQConsumerNotDeliverAllError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerWQConsumerNotDeliverAllError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerWQConsumerNotDeliverAllError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerWQConsumerNotDeliverAllError creates a new JSConsumerWQConsumerNotDeliverAllErr error: "consumer must be deliver all on workqueue stream"


name: NewJSConsumerWQConsumerNotUniqueError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerWQConsumerNotUniqueError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerWQConsumerNotUniqueError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerWQConsumerNotUniqueError creates a new JSConsumerWQConsumerNotUniqueErr error: "filtered consumer not unique on workqueue stream"


name: NewJSConsumerWQMultipleUnfilteredError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerWQMultipleUnfilteredError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerWQMultipleUnfilteredError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerWQMultipleUnfilteredError creates a new JSConsumerWQMultipleUnfilteredErr error: "multiple non-filtered consumers not allowed on workqueue stream"


name: NewJSConsumerWQRequiresExplicitAckError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerWQRequiresExplicitAckError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerWQRequiresExplicitAckError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerWQRequiresExplicitAckError creates a new JSConsumerWQRequiresExplicitAckErr error: "workqueue stream requires explicit ack"


name: NewJSConsumerWithFlowControlNeedsHeartbeatsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSConsumerWithFlowControlNeedsHeartbeatsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSConsumerWithFlowControlNeedsHeartbeatsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSConsumerWithFlowControlNeedsHeartbeatsError creates a new JSConsumerWithFlowControlNeedsHeartbeats error: "consumer with flow control also needs heartbeats"


name: NewJSInsufficientResourcesError
go_file: server/jetstream_errors_generated.go
go_method: NewJSInsufficientResourcesError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSInsufficientResourcesError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSInsufficientResourcesError creates a new JSInsufficientResourcesErr error: "insufficient resources"


name: NewJSMaximumConsumersLimitError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMaximumConsumersLimitError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMaximumConsumersLimitError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSMaximumConsumersLimitError creates a new JSMaximumConsumersLimitErr error: "maximum consumers limit reached"


name: NewJSMaximumStreamsLimitError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMaximumStreamsLimitError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMaximumStreamsLimitError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSMaximumStreamsLimitError creates a new JSMaximumStreamsLimitErr error: "maximum number of streams reached"


name: NewJSMemoryResourcesExceededError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMemoryResourcesExceededError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMemoryResourcesExceededError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:39:27
description:
NewJSMemoryResourcesExceededError creates a new JSMemoryResourcesExceededErr error: "insufficient memory resources available"


name: NewJSMessageCounterBrokenError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageCounterBrokenError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageCounterBrokenError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageCounterBrokenError creates a new JSMessageCounterBrokenErr error: "message counter is broken"


name: NewJSMessageIncrDisabledError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageIncrDisabledError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageIncrDisabledError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageIncrDisabledError creates a new JSMessageIncrDisabledErr error: "message counters is disabled"


name: NewJSMessageIncrInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageIncrInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageIncrInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageIncrInvalidError creates a new JSMessageIncrInvalidErr error: "message counter increment is invalid"


name: NewJSMessageIncrMissingError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageIncrMissingError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageIncrMissingError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageIncrMissingError creates a new JSMessageIncrMissingErr error: "message counter increment is missing"


name: NewJSMessageIncrPayloadError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageIncrPayloadError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageIncrPayloadError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageIncrPayloadError creates a new JSMessageIncrPayloadErr error: "message counter has payload"


name: NewJSMessageSchedulesDisabledError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageSchedulesDisabledError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageSchedulesDisabledError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageSchedulesDisabledError creates a new JSMessageSchedulesDisabledErr error: "message schedules is disabled"


name: NewJSMessageSchedulesPatternInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageSchedulesPatternInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageSchedulesPatternInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageSchedulesPatternInvalidError creates a new JSMessageSchedulesPatternInvalidErr error: "message schedules pattern is invalid"


name: NewJSMessageSchedulesRollupInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageSchedulesRollupInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageSchedulesRollupInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageSchedulesRollupInvalidError creates a new JSMessageSchedulesRollupInvalidErr error: "message schedules invalid rollup"


name: NewJSMessageSchedulesSourceInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageSchedulesSourceInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageSchedulesSourceInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageSchedulesSourceInvalidError creates a new JSMessageSchedulesSourceInvalidErr error: "message schedules source is invalid"


name: NewJSMessageSchedulesTTLInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageSchedulesTTLInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageSchedulesTTLInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageSchedulesTTLInvalidError creates a new JSMessageSchedulesTTLInvalidErr error: "message schedules invalid per-message TTL"


name: NewJSMessageSchedulesTargetInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageSchedulesTargetInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageSchedulesTargetInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageSchedulesTargetInvalidError creates a new JSMessageSchedulesTargetInvalidErr error: "message schedules target is invalid"


name: NewJSMessageTTLDisabledError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMessageTTLDisabledError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMessageTTLDisabledError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMessageTTLDisabledError creates a new JSMessageTTLDisabledErr error: "per-message TTL is disabled"


name: NewJSMirrorInvalidStreamNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorInvalidStreamNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorInvalidStreamNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMirrorInvalidStreamNameError creates a new JSMirrorInvalidStreamName error: "mirrored stream name is invalid"


name: NewJSMirrorInvalidSubjectFilterError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorInvalidSubjectFilterError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorInvalidSubjectFilterError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMirrorInvalidSubjectFilterError creates a new JSMirrorInvalidSubjectFilter error: "mirror transform source: {err}"


name: NewJSMirrorInvalidTransformDestinationError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorInvalidTransformDestinationError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorInvalidTransformDestinationError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMirrorInvalidTransformDestinationError creates a new JSMirrorInvalidTransformDestination error: "mirror transform: {err}"


name: NewJSMirrorMaxMessageSizeTooBigError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorMaxMessageSizeTooBigError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorMaxMessageSizeTooBigError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMirrorMaxMessageSizeTooBigError creates a new JSMirrorMaxMessageSizeTooBigErr error: "stream mirror must have max message size >= source"


name: NewJSMirrorMultipleFiltersNotAllowedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorMultipleFiltersNotAllowedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorMultipleFiltersNotAllowedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMirrorMultipleFiltersNotAllowedError creates a new JSMirrorMultipleFiltersNotAllowed error: "mirror with multiple subject transforms cannot also have a single subject filter"


name: NewJSMirrorOverlappingSubjectFiltersError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorOverlappingSubjectFiltersError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorOverlappingSubjectFiltersError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:42:53
description:
NewJSMirrorOverlappingSubjectFiltersError creates a new JSMirrorOverlappingSubjectFilters error: "mirror subject filters can not overlap"


name: NewJSMirrorWithAtomicPublishError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithAtomicPublishError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithAtomicPublishError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithAtomicPublishError creates a new JSMirrorWithAtomicPublishErr error: "stream mirrors can not also use atomic publishing"


name: NewJSMirrorWithCountersError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithCountersError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithCountersError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithCountersError creates a new JSMirrorWithCountersErr error: "stream mirrors can not also calculate counters"


name: NewJSMirrorWithFirstSeqError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithFirstSeqError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithFirstSeqError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithFirstSeqError creates a new JSMirrorWithFirstSeqErr error: "stream mirrors can not have first sequence configured"


name: NewJSMirrorWithMsgSchedulesError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithMsgSchedulesError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithMsgSchedulesError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithMsgSchedulesError creates a new JSMirrorWithMsgSchedulesErr error: "stream mirrors can not also schedule messages"


name: NewJSMirrorWithSourcesError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithSourcesError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithSourcesError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithSourcesError creates a new JSMirrorWithSourcesErr error: "stream mirrors can not also contain other sources"


name: NewJSMirrorWithStartSeqAndTimeError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithStartSeqAndTimeError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithStartSeqAndTimeError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithStartSeqAndTimeError creates a new JSMirrorWithStartSeqAndTimeErr error: "stream mirrors can not have both start seq and start time configured"


name: NewJSMirrorWithSubjectFiltersError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithSubjectFiltersError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithSubjectFiltersError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithSubjectFiltersError creates a new JSMirrorWithSubjectFiltersErr error: "stream mirrors can not contain filtered subjects"


name: NewJSMirrorWithSubjectsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSMirrorWithSubjectsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSMirrorWithSubjectsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSMirrorWithSubjectsError creates a new JSMirrorWithSubjectsErr error: "stream mirrors can not contain subjects"


name: NewJSNoLimitsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSNoLimitsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSNoLimitsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSNoLimitsError creates a new JSNoLimitsErr error: "no JetStream default or applicable tiered limit present"


name: NewJSNotEmptyRequestError
go_file: server/jetstream_errors_generated.go
go_method: NewJSNotEmptyRequestError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSNotEmptyRequestError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSNotEmptyRequestError creates a new JSNotEmptyRequestErr error: "expected an empty request payload"


name: NewJSNotEnabledForAccountError
go_file: server/jetstream_errors_generated.go
go_method: NewJSNotEnabledForAccountError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSNotEnabledForAccountError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSNotEnabledForAccountError creates a new JSNotEnabledForAccountErr error: "JetStream not enabled for account"


name: NewJSReplicasCountCannotBeNegativeError
go_file: server/jetstream_errors_generated.go
go_method: NewJSReplicasCountCannotBeNegativeError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSReplicasCountCannotBeNegativeError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSReplicasCountCannotBeNegativeError creates a new JSReplicasCountCannotBeNegative error: "replicas count cannot be negative"


name: NewJSRequiredApiLevelError
go_file: server/jetstream_errors_generated.go
go_method: NewJSRequiredApiLevelError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSRequiredApiLevelError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSRequiredApiLevelError creates a new JSRequiredApiLevelErr error: "JetStream minimum api level required"


name: NewJSRestoreSubscribeFailedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSRestoreSubscribeFailedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSRestoreSubscribeFailedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:46:32
description:
NewJSRestoreSubscribeFailedError creates a new JSRestoreSubscribeFailedErrF error: "JetStream unable to subscribe to restore snapshot {subject}: {err}"


name: NewJSSnapshotDeliverSubjectInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSnapshotDeliverSubjectInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSnapshotDeliverSubjectInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSnapshotDeliverSubjectInvalidError creates a new JSSnapshotDeliverSubjectInvalidErr error: "deliver subject not valid"


name: NewJSSourceDuplicateDetectedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceDuplicateDetectedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceDuplicateDetectedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceDuplicateDetectedError creates a new JSSourceDuplicateDetected error: "duplicate source configuration detected"


name: NewJSSourceInvalidStreamNameError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceInvalidStreamNameError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceInvalidStreamNameError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceInvalidStreamNameError creates a new JSSourceInvalidStreamName error: "sourced stream name is invalid"


name: NewJSSourceInvalidSubjectFilterError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceInvalidSubjectFilterError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceInvalidSubjectFilterError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceInvalidSubjectFilterError creates a new JSSourceInvalidSubjectFilter error: "source transform source: {err}"


name: NewJSSourceInvalidTransformDestinationError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceInvalidTransformDestinationError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceInvalidTransformDestinationError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceInvalidTransformDestinationError creates a new JSSourceInvalidTransformDestination error: "source transform: {err}"


name: NewJSSourceMaxMessageSizeTooBigError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceMaxMessageSizeTooBigError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceMaxMessageSizeTooBigError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceMaxMessageSizeTooBigError creates a new JSSourceMaxMessageSizeTooBigErr error: "stream source must have max message size >= target"


name: NewJSSourceMultipleFiltersNotAllowedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceMultipleFiltersNotAllowedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceMultipleFiltersNotAllowedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceMultipleFiltersNotAllowedError creates a new JSSourceMultipleFiltersNotAllowed error: "source with multiple subject transforms cannot also have a single subject filter"


name: NewJSSourceOverlappingSubjectFiltersError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceOverlappingSubjectFiltersError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceOverlappingSubjectFiltersError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceOverlappingSubjectFiltersError creates a new JSSourceOverlappingSubjectFilters error: "source filters can not overlap"


name: NewJSSourceWithMsgSchedulesError
go_file: server/jetstream_errors_generated.go
go_method: NewJSSourceWithMsgSchedulesError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSSourceWithMsgSchedulesError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSSourceWithMsgSchedulesError creates a new JSSourceWithMsgSchedulesErr error: "stream source can not also schedule messages"


name: NewJSStorageResourcesExceededError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStorageResourcesExceededError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStorageResourcesExceededError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSStorageResourcesExceededError creates a new JSStorageResourcesExceededErr error: "insufficient storage resources available"


name: NewJSStreamDuplicateMessageConflictError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamDuplicateMessageConflictError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamDuplicateMessageConflictError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSStreamDuplicateMessageConflictError creates a new JSStreamDuplicateMessageConflict error: "duplicate message id is in process"


name: NewJSStreamExpectedLastSeqPerSubjectInvalidError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamExpectedLastSeqPerSubjectInvalidError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamExpectedLastSeqPerSubjectInvalidError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSStreamExpectedLastSeqPerSubjectInvalidError creates a new JSStreamExpectedLastSeqPerSubjectInvalid error: "missing sequence for expected last sequence per subject"


name: NewJSStreamExpectedLastSeqPerSubjectNotReadyError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamExpectedLastSeqPerSubjectNotReadyError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamExpectedLastSeqPerSubjectNotReadyError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSStreamExpectedLastSeqPerSubjectNotReadyError creates a new JSStreamExpectedLastSeqPerSubjectNotReady error: "expected last sequence per subject temporarily unavailable"


name: NewJSStreamExternalApiOverlapError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamExternalApiOverlapError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamExternalApiOverlapError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSStreamExternalApiOverlapError creates a new JSStreamExternalApiOverlapErrF error: "stream external api prefix {prefix} must not overlap with {subject}"


name: NewJSStreamExternalDelPrefixOverlapsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamExternalDelPrefixOverlapsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamExternalDelPrefixOverlapsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:50:24
description:
NewJSStreamExternalDelPrefixOverlapsError creates a new JSStreamExternalDelPrefixOverlapsErrF error: "stream external delivery prefix {prefix} overlaps with stream subject {subject}"


name: NewJSStreamHeaderExceedsMaximumError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamHeaderExceedsMaximumError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamHeaderExceedsMaximumError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamHeaderExceedsMaximumError creates a new JSStreamHeaderExceedsMaximumErr error: "header size exceeds maximum allowed of 64k"


name: NewJSStreamInfoMaxSubjectsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamInfoMaxSubjectsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamInfoMaxSubjectsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamInfoMaxSubjectsError creates a new JSStreamInfoMaxSubjectsErr error: "subject details would exceed maximum allowed"


name: NewJSStreamInvalidExternalDeliverySubjError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamInvalidExternalDeliverySubjError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamInvalidExternalDeliverySubjError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamInvalidExternalDeliverySubjError creates a new JSStreamInvalidExternalDeliverySubjErrF error: "stream external delivery prefix {prefix} must not contain wildcards"


name: NewJSStreamMaxBytesRequiredError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMaxBytesRequiredError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMaxBytesRequiredError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMaxBytesRequiredError creates a new JSStreamMaxBytesRequired error: "account requires a stream config to have max bytes set"


name: NewJSStreamMaxStreamBytesExceededError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMaxStreamBytesExceededError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMaxStreamBytesExceededError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMaxStreamBytesExceededError creates a new JSStreamMaxStreamBytesExceeded error: "stream max bytes exceeds account limit max stream bytes"


name: NewJSStreamMessageExceedsMaximumError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMessageExceedsMaximumError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMessageExceedsMaximumError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMessageExceedsMaximumError creates a new JSStreamMessageExceedsMaximumErr error: "message size exceeds maximum allowed"


name: NewJSStreamMirrorNotUpdatableError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMirrorNotUpdatableError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMirrorNotUpdatableError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMirrorNotUpdatableError creates a new JSStreamMirrorNotUpdatableErr error: "stream mirror configuration can not be updated"


name: NewJSStreamMismatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMismatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMismatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMismatchError creates a new JSStreamMismatchErr error: "stream name in subject does not match request"


name: NewJSStreamMoveAndScaleError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMoveAndScaleError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMoveAndScaleError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMoveAndScaleError creates a new JSStreamMoveAndScaleErr error: "can not move and scale a stream in a single update"


name: NewJSStreamMoveInProgressError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMoveInProgressError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMoveInProgressError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMoveInProgressError creates a new JSStreamMoveInProgressF error: "stream move already in progress: {msg}"


name: NewJSStreamMoveNotInProgressError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamMoveNotInProgressError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamMoveNotInProgressError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamMoveNotInProgressError creates a new JSStreamMoveNotInProgress error: "stream move not in progress"


name: NewJSStreamNameContainsPathSeparatorsError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamNameContainsPathSeparatorsError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamNameContainsPathSeparatorsError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamNameContainsPathSeparatorsError creates a new JSStreamNameContainsPathSeparatorsErr error: "Stream name can not contain path separators"


name: NewJSStreamNameExistError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamNameExistError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamNameExistError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamNameExistError creates a new JSStreamNameExistErr error: "stream name already in use with a different configuration"


name: NewJSStreamNameExistRestoreFailedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamNameExistRestoreFailedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamNameExistRestoreFailedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:54:35
description:
NewJSStreamNameExistRestoreFailedError creates a new JSStreamNameExistRestoreFailedErr error: "stream name already in use, cannot restore"


name: NewJSStreamOfflineReasonError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamOfflineReasonError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamOfflineReasonError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamOfflineReasonError creates a new JSStreamOfflineReasonErrF error: "stream is offline: {err}"


name: NewJSStreamReplicasNotSupportedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamReplicasNotSupportedError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamReplicasNotSupportedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamReplicasNotSupportedError creates a new JSStreamReplicasNotSupportedErr error: "replicas > 1 not supported in non-clustered mode"


name: NewJSStreamReplicasNotUpdatableError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamReplicasNotUpdatableError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamReplicasNotUpdatableError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamReplicasNotUpdatableError creates a new JSStreamReplicasNotUpdatableErr error: "Replicas configuration can not be updated"


name: NewJSStreamSequenceNotMatchError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamSequenceNotMatchError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamSequenceNotMatchError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamSequenceNotMatchError creates a new JSStreamSequenceNotMatchErr error: "expected stream sequence does not match"


name: NewJSStreamSubjectOverlapError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamSubjectOverlapError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamSubjectOverlapError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamSubjectOverlapError creates a new JSStreamSubjectOverlapErr error: "subjects overlap with an existing stream"


name: NewJSStreamTemplateNotFoundError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamTemplateNotFoundError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamTemplateNotFoundError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamTemplateNotFoundError creates a new JSStreamTemplateNotFoundErr error: "template not found"


name: NewJSStreamTransformInvalidDestinationError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamTransformInvalidDestinationError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamTransformInvalidDestinationError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamTransformInvalidDestinationError creates a new JSStreamTransformInvalidDestination error: "stream transform: {err}"


name: NewJSStreamTransformInvalidSourceError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamTransformInvalidSourceError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamTransformInvalidSourceError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:59:04
description:
NewJSStreamTransformInvalidSourceError creates a new JSStreamTransformInvalidSource error: "stream transform source: {err}"


name: NewJSStreamWrongLastMsgIDError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamWrongLastMsgIDError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamWrongLastMsgIDError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NewJSStreamWrongLastMsgIDError creates a new JSStreamWrongLastMsgIDErrF error: "wrong last msg ID: {id}"


name: NewJSStreamWrongLastSequenceConstantError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamWrongLastSequenceConstantError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamWrongLastSequenceConstantError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NewJSStreamWrongLastSequenceConstantError creates a new JSStreamWrongLastSequenceConstantErr error: "wrong last sequence"


name: NewJSStreamWrongLastSequenceError
go_file: server/jetstream_errors_generated.go
go_method: NewJSStreamWrongLastSequenceError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSStreamWrongLastSequenceError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NewJSStreamWrongLastSequenceError creates a new JSStreamWrongLastSequenceErrF error: "wrong last sequence: {seq}"


name: NewJSTempStorageFailedError
go_file: server/jetstream_errors_generated.go
go_method: NewJSTempStorageFailedError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSTempStorageFailedError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NewJSTempStorageFailedError creates a new JSTempStorageFailedErr error: "JetStream unable to open temp storage for restore"


name: NewJSTemplateNameNotMatchSubjectError
go_file: server/jetstream_errors_generated.go
go_method: NewJSTemplateNameNotMatchSubjectError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsApiErrors
dotnet_method: NewJSTemplateNameNotMatchSubjectError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NewJSTemplateNameNotMatchSubjectError creates a new JSTemplateNameNotMatchSubjectErr error: "template name in subject does not match request"


name: Server.publishAdvisory
go_file: server/jetstream_events.go
go_class: Server
go_method: publishAdvisory
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamEvents
dotnet_method: PublishAdvisory
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
publishAdvisory sends the given advisory into the account. Returns true if
it was sent, false if not (i.e. due to lack of interest or a marshal error).


name: supportsRequiredApiLevel
go_file: server/jetstream_versioning.go
go_method: supportsRequiredApiLevel
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamVersioning
dotnet_method: SupportsRequiredApiLevel
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
supportsRequiredApiLevel returns whether the required API level for the JetStream asset is supported.


name: setStaticStreamMetadata
go_file: server/jetstream_versioning.go
go_method: setStaticStreamMetadata
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamVersioning
dotnet_method: SetStaticStreamMetadata
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
setStaticStreamMetadata sets JetStream stream metadata, like the server version and API level.
Any dynamic metadata is removed, it must not be stored and only be added for responses.


name: copyStreamMetadata
go_file: server/jetstream_versioning.go
go_method: copyStreamMetadata
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamVersioning
dotnet_method: CopyStreamMetadata
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
copyConsumerMetadata copies versioning fields from metadata of prevCfg into cfg.
Removes versioning fields if no previous metadata, updates if set, and removes fields if it doesn't exist in prevCfg.
Any dynamic metadata is removed, it must not be stored and only be added for responses.

Note: useful when doing equality checks on cfg and prevCfg, but ignoring any versioning metadata differences.


name: setOrDeleteInStreamMetadata
go_file: server/jetstream_versioning.go
go_method: setOrDeleteInStreamMetadata
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamVersioning
dotnet_method: SetOrDeleteInStreamMetadata
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
setOrDeleteInConsumerMetadata sets field with key/value in metadata of cfg if set, deletes otherwise.


name: setStaticConsumerMetadata
go_file: server/jetstream_versioning.go
go_method: setStaticConsumerMetadata
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamVersioning
dotnet_method: SetStaticConsumerMetadata
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
setStaticConsumerMetadata sets JetStream consumer metadata, like the server version and API level.
Any dynamic metadata is removed, it must not be stored and only be added for responses.


name: errorOnRequiredApiLevel
go_file: server/jetstream_versioning.go
go_method: errorOnRequiredApiLevel
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamVersioning
dotnet_method: ErrorOnRequiredApiLevel
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
errorOnRequiredApiLevel returns whether a request should be rejected based on the JSRequiredApiLevel header.


name: validateTrustedOperators
go_file: server/jwt.go
go_method: validateTrustedOperators
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JwtProcessor
dotnet_method: ValidateTrustedOperators
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
validateTrustedOperators will check that we do not have conflicts with
assigned trusted keys and trusted operators. If operators are defined we
will expand the trusted keys in options.


name: client.isSpokeLeafNode
go_file: server/leafnode.go
go_class: client
go_method: isSpokeLeafNode
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: IsSpokeLeafNode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns true if this is a solicited leafnode and is not configured to be treated as a hub or a receiving
connection leafnode where the otherside has declared itself to be the hub.


name: validateLeafNodeAuthOptions
go_file: server/leafnode.go
go_method: validateLeafNodeAuthOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: LeafNodeHandler
dotnet_method: ValidateLeafNodeAuthOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used to validate user names in LeafNode configuration.
- rejects mix of single and multiple users.
- rejects duplicate user names.


name: Server.clearObserverState
go_file: server/leafnode.go
go_class: Server
go_method: clearObserverState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ClearObserverState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will clear any observer state such that stream or consumer assets on this server can become leaders again.


name: leafNodeCfg.saveTLSHostname
go_file: server/leafnode.go
go_class: leafNodeCfg
go_method: saveTLSHostname
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: LeafNodeCfg
dotnet_method: SaveTLSHostname
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Save off the tlsName for when we use TLS and mix hostnames and IPs. IPs usually
come from the server we connect to.

We used to save the name only if there was a TLSConfig or scheme equal to "tls".
However, this was causing failures for users that did not set the scheme (and
their remote connections did not have a tls{} block).
We now save the host name regardless in case the remote returns an INFO indicating
that TLS is required.


name: leafNodeCfg.saveUserPassword
go_file: server/leafnode.go
go_class: leafNodeCfg
go_method: saveUserPassword
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: LeafNodeCfg
dotnet_method: SaveUserPassword
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Save off the username/password for when we connect using a bare URL
that we get from the INFO protocol.


name: Server.startLeafNodeAcceptLoop
go_file: server/leafnode.go
go_class: Server
go_method: startLeafNodeAcceptLoop
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StartLeafNodeAcceptLoop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This starts the leafnode accept loop in a go routine, unless it
is detected that the server has already been shutdown.


name: client.sendLeafConnect
go_file: server/leafnode.go
go_class: client
go_method: sendLeafConnect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendLeafConnect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
clusterName is provided as argument to avoid lock ordering issues with the locked client c
Lock should be held entering here.


name: Server.addLeafNodeURL
go_file: server/leafnode.go
go_class: Server
go_method: addLeafNodeURL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AddLeafNodeURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Adds a LeafNode URL that we get when a route connects to the Info structure.
Regenerates the JSON byte array so that it can be sent to LeafNode connections.
Returns a boolean indicating if the URL was added or not.
Server lock is held on entry


name: Server.removeLeafNodeURL
go_file: server/leafnode.go
go_class: Server
go_method: removeLeafNodeURL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RemoveLeafNodeURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Removes a LeafNode URL of the route that is disconnecting from the Info structure.
Regenerates the JSON byte array so that it can be sent to LeafNode connections.
Returns a boolean indicating if the URL was removed or not.
Server lock is held on entry.


name: client.leafClientHandshakeIfNeeded
go_file: server/leafnode.go
go_class: client
go_method: leafClientHandshakeIfNeeded
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: LeafClientHandshakeIfNeeded
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Will perform the client-side TLS handshake if needed. Assumes that this
is called by the solicit side (remote will be non nil). Returns `true`
if TLS is required, `false` otherwise.
Lock held on entry.


name: client.updateLeafNodeURLs
go_file: server/leafnode.go
go_class: client
go_method: updateLeafNodeURLs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: UpdateLeafNodeURLs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
When getting a leaf node INFO protocol, use the provided
array of urls to update the list of possible endpoints.


name: Server.addLeafNodeConnection
go_file: server/leafnode.go
go_class: Server
go_method: addLeafNodeConnection
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AddLeafNodeConnection
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Add the connection to the map of leaf nodes.
If `checkForDup` is true (invoked when a leafnode is accepted), then we check
if a connection already exists for the same server name and account.
That can happen when the remote is attempting to reconnect while the accepting
side did not detect the connection as broken yet.
But it can also happen when there is a misconfiguration and the remote is
creating two (or more) connections that bind to the same account on the accept
side.
When a duplicate is found, the new connection is accepted and the old is closed
(this solves the stale connection situation). An error is returned to help the
remote detect the misconfiguration when the duplicate is the result of that
misconfiguration.


name: client.processLeafNodeConnect
go_file: server/leafnode.go
go_class: client
go_method: processLeafNodeConnect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessLeafNodeConnect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processLeafNodeConnect will process the inbound connect args.
Once we are here we are bound to an account, so can send any interest that
we would have to the other side.


name: Server.sendPermsAndAccountInfo
go_file: server/leafnode.go
go_class: Server
go_method: sendPermsAndAccountInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendPermsAndAccountInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sends back an info block to the soliciting leafnode to let it know about
its permission settings for local enforcement.


name: Server.initLeafNodeSmapAndSendSubs
go_file: server/leafnode.go
go_class: Server
go_method: initLeafNodeSmapAndSendSubs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InitLeafNodeSmapAndSendSubs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Snapshot the current subscriptions from the sublist into our smap which
we will keep updated from now on.
Also send the registered subscriptions.


name: Account.updateLeafNodesEx
go_file: server/leafnode.go
go_class: Account
go_method: updateLeafNodesEx
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: UpdateLeafNodesEx
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
updateLeafNodesEx will make sure to update the account smap for the subscription.
Will also forward to all leaf nodes as needed.
If `hubOnly` is true, then will update only leaf nodes that connect to this server
(that is, for which this server acts as a hub to them).


name: Account.updateLeafNodes
go_file: server/leafnode.go
go_class: Account
go_method: updateLeafNodes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Account
dotnet_method: UpdateLeafNodes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
updateLeafNodes will make sure to update the account smap for the subscription.
Will also forward to all leaf nodes as needed.


name: client.updateSmap
go_file: server/leafnode.go
go_class: client
go_method: updateSmap
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: UpdateSmap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
This will make an update to our internal smap and determine if we should send out
an interest update to the remote side.
Lock should be held.


name: keyFromSubWithOrigin
go_file: server/leafnode.go
go_method: keyFromSubWithOrigin
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: LeafNodeHandler
dotnet_method: KeyFromSubWithOrigin
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper function to build the key that prevents collisions between normal
routed subscriptions and routed subscriptions on behalf of a leafnode.
Keys will look like this:
"R foo"          -> plain routed sub on "foo"
"R foo bar"      -> queue routed sub on "foo", queue "bar"
"L foo bar"      -> plain routed leaf sub on "foo", leaf "bar"
"L foo bar baz"  -> queue routed sub on "foo", queue "bar", leaf "baz"


name: client.handleLeafNodeLoop
go_file: server/leafnode.go
go_class: client
go_method: handleLeafNodeLoop
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: HandleLeafNodeLoop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
If the leafnode is a solicited, set the connect delay based on default
or private option (for tests). Sends the error to the other side, log and
close the connection.


name: client.leafPermViolation
go_file: server/leafnode.go
go_class: client
go_method: leafPermViolation
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: LeafPermViolation
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Common function to process publish or subscribe leafnode permission violation.
Sends the permission violation error to the remote, logs it and closes the connection.
If this is from a server soliciting, the reconnection will be delayed.


name: client.setLeafConnectDelayIfSoliciting
go_file: server/leafnode.go
go_class: client
go_method: setLeafConnectDelayIfSoliciting
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetLeafConnectDelayIfSoliciting
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
If this leaf connection solicits, sets the connect delay to the given value,
or the one from the server option's LeafNode.connDelay if one is set (for tests).
Returns the connection's account name and delay.


name: client.leafNodeGetTLSConfigForSolicit
go_file: server/leafnode.go
go_class: client
go_method: leafNodeGetTLSConfigForSolicit
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: LeafNodeGetTLSConfigForSolicit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
For the given remote Leafnode configuration, this function returns
if TLS is required, and if so, will return a clone of the TLS Config
(since some fields will be changed during handshake), the TLS server
name that is remembered, and the TLS timeout.


name: client.leafNodeSolicitWSConnection
go_file: server/leafnode.go
go_class: client
go_method: leafNodeSolicitWSConnection
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: LeafNodeSolicitWSConnection
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Initiates the LeafNode Websocket connection by:
- doing the TLS handshake if needed
- sending the HTTP request
- waiting for the HTTP response

Since some bufio reader is used to consume the HTTP response, this function
returns the slice of buffered bytes (if any) so that the readLoop that will
be started after that consume those first before reading from the socket.
The boolean

Lock held on entry.


name: Server.leafNodeFinishConnectProcess
go_file: server/leafnode.go
go_class: Server
go_method: leafNodeFinishConnectProcess
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LeafNodeFinishConnectProcess
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is invoked for remote LEAF connections after processing the INFO
protocol and leafNodeResumeConnectProcess.
This will send LS+ the CONNECT protocol and register the leaf node.


name: Server.ReOpenLogFile
go_file: server/log.go
go_class: Server
go_method: ReOpenLogFile
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReOpenLogFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:56:25
description:
ReOpenLogFile if the logger is a file based logger, close and re-open the file.
This allows for file rotation by 'mv'ing the file then signaling
the process to trigger this function.


name: memStore.NumPending
go_file: server/memstore.go
go_class: memStore
go_method: NumPending
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamMemStore
dotnet_method: NumPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NumPending will return the number of pending messages matching the filter subject starting at sequence.


name: memStore.NumPendingMulti
go_file: server/memstore.go
go_class: memStore
go_method: NumPendingMulti
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamMemStore
dotnet_method: NumPendingMulti
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
NumPending will return the number of pending messages matching any subject in the sublist starting at sequence.


name: memStore.LoadNextMsg
go_file: server/memstore.go
go_class: memStore
go_method: LoadNextMsg
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamMemStore
dotnet_method: LoadNextMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
LoadNextMsg will find the next message matching the filter subject starting at the start sequence.
The filter subject can be a wildcard.


name: memStore.nextWildcardMatchLocked
go_file: server/memstore.go
go_class: memStore
go_method: nextWildcardMatchLocked
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamMemStore
dotnet_method: NextWildcardMatchLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:18:20
description:
Find sequence bounds matching a wildcard filter from ms.fss.
Returns (first, last, true) if there is at least one matching
subject at or after start (start <= first <= last).
Returns (0, 0, false) if the subject does not exist or has no
messages at or after start.
Lock should be held.


name: memStore.nextLiteralMatchLocked
go_file: server/memstore.go
go_class: memStore
go_method: nextLiteralMatchLocked
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamMemStore
dotnet_method: NextLiteralMatchLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:18:20
description:
Find sequence bounds matching a literal filter from ms.fss.
Returns (first, last, true) if there is a matching literal
subject at or after start (start <= first <= last).
Returns (0, 0, false) if the subject does not exist or has no
messages at or after start.
Lock should be held.


name: memStore.shouldLinearScan
go_file: server/memstore.go
go_class: memStore
go_method: shouldLinearScan
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JetStreamMemStore
dotnet_method: ShouldLinearScan
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:18:20
description:
Returns true if LoadNextMsg should perform a linear scan,
false if it should use the subject tree to try to reduce
the search space.
Lock should be held.


name: createProxyInfo
go_file: server/monitor.go
go_method: createProxyInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MonitoringHandler
dotnet_method: CreateProxyInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If this client came from a trusted proxy, this will return a ProxyInfo
to be used in ConnInfo or LeafInfo.

Client lock must be held on entry.


name: Server.updateVarzConfigReloadableFields
go_file: server/monitor.go
go_class: Server
go_method: updateVarzConfigReloadableFields
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateVarzConfigReloadableFields
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Invoked during configuration reload once options have possibly be changed
and config load time has been set. If s.varz has not been initialized yet
(because no pooling of /varz has been made), this function does nothing.
Server lock is held on entry.


name: Server.updateVarzRuntimeFields
go_file: server/monitor.go
go_class: Server
go_method: updateVarzRuntimeFields
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateVarzRuntimeFields
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Updates the runtime Varz fields, that is, fields that change during
runtime and that should be updated any time Varz() or polling of /varz
is done.
Server lock is held on entry.


name: getMonitorGWOptions
go_file: server/monitor.go
go_method: getMonitorGWOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MonitoringHandler
dotnet_method: GetMonitorGWOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Based on give options struct, returns if there is a filtered
Gateway Name and if we should do report Accounts.
Note that if Accounts is false but AccountName is not empty,
then Accounts is implicitly set to true.


name: Server.createOutboundsRemoteGatewayz
go_file: server/monitor.go
go_class: Server
go_method: createOutboundsRemoteGatewayz
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CreateOutboundsRemoteGatewayz
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns a map of gateways outbound connections.
Based on options, will include a single or all gateways,
with no/single/or all accounts interest information.


name: createOutboundAccountsGatewayz
go_file: server/monitor.go
go_method: createOutboundAccountsGatewayz
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MonitoringHandler
dotnet_method: CreateOutboundAccountsGatewayz
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the list of accounts for this outbound gateway connection.
Based on the options, it will be a single or all accounts for
this outbound.


name: Server.createInboundsRemoteGatewayz
go_file: server/monitor.go
go_class: Server
go_method: createInboundsRemoteGatewayz
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CreateInboundsRemoteGatewayz
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns a map of gateways inbound connections.
Each entry is an array of RemoteGatewayz since a given server
may have more than one inbound from the same remote gateway.
Based on options, will include a single or all gateways,
with no/single/or all accounts interest information.


name: createInboundAccountsGatewayz
go_file: server/monitor.go
go_method: createInboundAccountsGatewayz
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MonitoringHandler
dotnet_method: CreateInboundAccountsGatewayz
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the list of accounts for this inbound gateway connection.
Based on the options, it will be a single or all accounts for
this inbound.


name: Server.createMQTTClient
go_file: server/mqtt.go
go_class: Server
go_method: createMQTTClient
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CreateMQTTClient
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is similar to createClient() but has some modifications specifi to MQTT clients.
The comments have been kept to minimum to reduce code size. Check createClient() for
more details.


name: Server.mqttConfigAuth
go_file: server/mqtt.go
go_class: Server
go_method: mqttConfigAuth
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttConfigAuth
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Given the mqtt options, we check if any auth configuration
has been provided. If so, possibly create users/nkey users and
store them in s.mqtt.users/nkeys.
Also update a boolean that indicates if auth is required for
mqtt clients.
Server lock is held on entry.


name: client.getMQTTClientID
go_file: server/mqtt.go
go_class: client
go_method: getMQTTClientID
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GetMQTTClientID
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
If this is an MQTT client, returns the session client ID,
otherwise returns the empty string.
Lock held on entry


name: Server.mqttHandleClosedClient
go_file: server/mqtt.go
go_class: Server
go_method: mqttHandleClosedClient
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttHandleClosedClient
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
The MQTT client connection has been closed, or the DISCONNECT packet was received.
For a "clean" session, we will delete the session, otherwise, simply removing
the binding. We will also send the "will" message if applicable.

Runs from the client's readLoop.
No lock held on entry.


name: Server.mqttUpdateMaxAckPending
go_file: server/mqtt.go
go_class: Server
go_method: mqttUpdateMaxAckPending
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttUpdateMaxAckPending
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Updates the MaxAckPending for all MQTT sessions, updating the
JetStream consumers and updating their max ack pending and forcing
a expiration of pending messages.

Runs from a server configuration reload routine.
No lock held on entry.


name: Server.getOrCreateMQTTAccountSessionManager
go_file: server/mqtt.go
go_class: Server
go_method: getOrCreateMQTTAccountSessionManager
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetOrCreateMQTTAccountSessionManager
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the MQTT sessions manager for a given account.
If new, creates the required JetStream streams/consumers
for handling of sessions and messages.


name: Server.mqttCreateAccountSessionManager
go_file: server/mqtt.go
go_class: Server
go_method: mqttCreateAccountSessionManager
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttCreateAccountSessionManager
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Creates JS streams/consumers for handling of sessions and messages for this account.

Global session manager lock is held on entry.


name: mqttJSA.newRequestExMulti
go_file: server/mqtt.go
go_class: mqttJSA
go_method: newRequestExMulti
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttJetStreamAdapter
dotnet_method: NewRequestExMulti
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
newRequestExMulti sends multiple messages on the same subject and waits for
all responses. It returns the same number of responses in the same order as
msgs parameter. In case of a timeout it returns an error as well as all
responses received as a sparsely populated array, matching msgs, with nils
for the values that have not yet been received.

Note that each response may represent an error and should be inspected as
such by the caller.


name: mqttAccountSessionManager.processJSAPIReplies
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: processJSAPIReplies
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: ProcessJSAPIReplies
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Process JS API replies.

Can run from various go routines (consumer's loop, system send loop, etc..).


name: mqttAccountSessionManager.processRetainedMsg
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: processRetainedMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: ProcessRetainedMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will both load all retained messages and process updates from the cluster.

Run from various go routines (JS consumer, etc..).
No lock held on entry.


name: mqttAccountSessionManager.processSessionPersist
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: processSessionPersist
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: ProcessSessionPersist
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will receive all JS API replies for a request to store a session record,
including the reply for our own server, which we will ignore.
This allows us to detect that some application somewhere else in the cluster
is connecting with the same client ID, and therefore we need to close the
connection that is currently using this client ID.

Can run from various go routines (system send loop, etc..).
No lock held on entry.


name: mqttAccountSessionManager.addSessToFlappers
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: addSessToFlappers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: AddSessToFlappers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Adds this client ID to the flappers map, and if needed start the timer
for map cleanup.

Lock held on entry.


name: mqttAccountSessionManager.cleanupRetainedMessageCache
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: cleanupRetainedMessageCache
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: CleanupRetainedMessageCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
A timer loop to cleanup up expired cached retained messages for a given MQTT account.
The closeCh is used by the caller to be able to interrupt this routine
if the rest of the initialization fails, since the quitCh is really
only used when the server shutdown.

No lock held on entry.


name: mqttAccountSessionManager.sendJSAPIrequests
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: sendJSAPIrequests
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: SendJSAPIrequests
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Loop to send JS API requests for a given MQTT account.
The closeCh is used by the caller to be able to interrupt this routine
if the rest of the initialization fails, since the quitCh is really
only used when the server shutdown.

No lock held on entry.


name: mqttAccountSessionManager.addRetainedMsg
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: addRetainedMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: AddRetainedMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Add/Replace this message from the retained messages map.
If a message for this topic already existed, the existing record is updated
with the provided information.
Lock not held on entry.


name: mqttAccountSessionManager.removeRetainedMsg
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: removeRetainedMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: RemoveRetainedMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Remove the retained message stored with the `subject` key from the map/cache.
When invoked from the retained message stream's consumer, this function will
be called with `seq == 0`, this is because add/remove are serialized in this
stream and so the request is to remove the current retained message.
But in some conditions, we will invoke this function from some other places
with `seq > 0` which means that the retained message will be removed only if
its sequence is the same than the provided one.
This function returns the sequence associated with the existing retained
message that is being removed (used with `seq == 0`) and returns 0 if the
retained message was not removed from the map (not found or sequence did not
match).


name: mqttAccountSessionManager.lockSession
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: lockSession
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: LockSession
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
First check if this session's client ID is already in the "locked" map,
which if it is the case means that another client is now bound to this
session and this should return an error.
If not in the "locked" map, but the client is not bound with this session,
then same error is returned.
Finally, if all checks ok, then the session's ID is added to the "locked" map.

No lock held on entry.


name: mqttAccountSessionManager.addSession
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: addSession
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: AddSession
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Simply adds the session to the various sessions maps.
The boolean `lock` indicates if this function should acquire the lock
prior to adding to the maps.

No lock held on entry.


name: mqttAccountSessionManager.removeSession
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: removeSession
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: RemoveSession
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Simply removes the session from the various sessions maps.
The boolean `lock` indicates if this function should acquire the lock
prior to removing from the maps.

No lock held on entry.


name: mqttSession.processQOS12Sub
go_file: server/mqtt.go
go_class: mqttSession
go_method: processQOS12Sub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: ProcessQOS12Sub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper to set the sub's mqtt fields and possibly serialize (pre-loaded)
retained messages.

Session lock held on entry. Acquires the subs lock and holds it for
the duration. Non-MQTT messages coming into mqttDeliverMsgCbQoS0 will be
waiting.


name: mqttAccountSessionManager.processSubs
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: processSubs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: ProcessSubs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Process subscriptions for the given session/client.

When `fromSubProto` is false, it means that this is invoked from the CONNECT
protocol, when restoring subscriptions that were saved for this session.
In that case, there is no need to update the session record.

When `fromSubProto` is true, it means that this call is invoked from the
processing of the SUBSCRIBE protocol, which means that the session needs to
be updated. It also means that if a subscription on same subject with same
QoS already exist, we should not be recreating the subscription/JS durable,
since it was already done when processing the CONNECT protocol.

Runs from the client's readLoop.
Lock not held on entry, but session is in the locked map.


name: mqttAccountSessionManager.serializeRetainedMsgsForSub
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: serializeRetainedMsgsForSub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: SerializeRetainedMsgsForSub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Retained publish messages matching this subscription are serialized in the
subscription's `prm` mqtt writer. This buffer will be queued for outbound
after the subscription is processed and SUBACK is sent or possibly when
server processes an incoming published message matching the newly
registered subscription.

Runs from the client's readLoop.
Account session manager lock held on entry.
Session lock held on entry.


name: mqttAccountSessionManager.addRetainedSubjectsForSubject
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: addRetainedSubjectsForSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: AddRetainedSubjectsForSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Appends the stored message subjects for all retained message records that
match the given subscription's `subject` (which could have wildcards).

Account session manager NOT lock held on entry.


name: mqttEncodeRetainedMessage
go_file: server/mqtt.go
go_method: mqttEncodeRetainedMessage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttEncodeRetainedMessage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Composes a NATS message for a storeable mqttRetainedMsg.
If the body is empty, the flags are encoded in a way that will cause older
servers to fail to decode the message in processRetainedMsg callback and
will simply ignore it, which is what we want.


name: mqttDecodeRetainedMessage
go_file: server/mqtt.go
go_method: mqttDecodeRetainedMessage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttDecodeRetainedMessage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Decodes a retained message based on the content of the header `h`.
The returned `*mqttRetainedMsg` object will hold a reference to `m`.
If the buffer `m` is not owned by the caller, it is the caller
responsibility to make a copy of the byte slice.


name: mqttAccountSessionManager.createOrRestoreSession
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: createOrRestoreSession
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: CreateOrRestoreSession
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Creates the session stream (limit msgs of 1) for this client ID if it does
not already exist. If it exists, recover the single record to rebuild the
state of the session. If there is a session record but this session is not
registered in the runtime of this server, then a request is made to the
owner to close the client associated with this session since specification
[MQTT-3.1.4-2] specifies that if the ClientId represents a Client already
connected to the Server then the Server MUST disconnect the existing client.

Runs from the client's readLoop.
Lock not held on entry, but session is in the locked map.


name: mqttAccountSessionManager.notifyRetainedMsgDeleted
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: notifyRetainedMsgDeleted
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: NotifyRetainedMsgDeleted
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sends a message indicating that a retained message on a given subject and stream sequence
is being removed.
NOTE: This is maintained for backward compatibility reasons. Should be removed in 2.14/2.15?


name: mqttAccountSessionManager.setCachedRetainedMsg
go_file: server/mqtt.go
go_class: mqttAccountSessionManager
go_method: setCachedRetainedMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttAccountSessionManager
dotnet_method: SetCachedRetainedMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If cache is enabled, the expiration for the `rm` is bumped by
`mqttRetainedCacheTTL` seconds.
If `onlyReplace` is true, then the `rm` object is stored in the cache using
the `subject` key only if there was already an object stored under that key.
If `copyMsgBytes` is true, then the `rm.Msg` bytes are copied (because it
references some buffer that is not owned by the caller).

Note: currently `onlyReplace` and `cloneMsgBytes` always have the same
value (all `true` or all `false`) however we use different booleans to
better express the intent.


name: mqttSessionCreate
go_file: server/mqtt.go
go_method: mqttSessionCreate
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttSessionCreate
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns a new mqttSession object with max ack pending set based on
option or use mqttDefaultMaxAckPending if no option set.


name: mqttSession.save
go_file: server/mqtt.go
go_class: mqttSession
go_method: save
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: Save
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Persists a session. Note that if the session's current client does not match
the given client, nothing is done.

Lock not held on entry.


name: mqttSession.clear
go_file: server/mqtt.go
go_class: mqttSession
go_method: clear
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: Clear
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Clear the session.

Runs from the client's readLoop.
Lock not held on entry, but session is in the locked map.


name: mqttSession.update
go_file: server/mqtt.go
go_class: mqttSession
go_method: update
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: Update
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will update the session record for this client in the account's MQTT
sessions stream if the session had any change in the subscriptions.

Runs from the client's readLoop.
Lock not held on entry, but session is in the locked map.


name: mqttSession.trackPublishRetained
go_file: server/mqtt.go
go_class: mqttSession
go_method: trackPublishRetained
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: TrackPublishRetained
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
trackPublishRetained is invoked when a retained (QoS) message is published.
It need a new PI to be allocated, so we add it to the pendingPublish map,
with an empty value. Since cpending (not pending) is used to serialize the PI
mappings, we need to add this PI there as well. Make a unique key by using
mqttRetainedMsgsStreamName for the durable name, and PI for sseq.

Lock held on entry


name: mqttSession.trackPublish
go_file: server/mqtt.go
go_class: mqttSession
go_method: trackPublish
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: TrackPublish
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
trackPublish is invoked when a (QoS) PUBLISH message is to be delivered. It
detects an untracked (new) message based on its sequence extracted from its
delivery-time jsAckSubject, and adds it to the tracking maps. Returns a PI to
use for the message (new, or previously used), and whether this is a
duplicate delivery attempt.

Lock held on entry


name: mqttSession.untrackPublish
go_file: server/mqtt.go
go_class: mqttSession
go_method: untrackPublish
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: UntrackPublish
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Stops a PI from being tracked as a PUBLISH. It can still be in use for a
pending PUBREL.

Lock held on entry


name: mqttSession.trackAsPubRel
go_file: server/mqtt.go
go_class: mqttSession
go_method: trackAsPubRel
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: TrackAsPubRel
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
trackAsPubRel is invoked in 2 cases: (a) when we receive a PUBREC and we need
to change from tracking the PI as a PUBLISH to a PUBREL; and (b) when we
attempt to deliver the PUBREL to record the JS ack subject for it.

Lock held on entry


name: Server.mqttProcessConnect
go_file: server/mqtt.go
go_class: Server
go_method: mqttProcessConnect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttProcessConnect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Process the CONNECT packet.

For the first session on the account, an account session manager will be created,
along with the JetStream streams/consumer necessary for the working of MQTT.

The session, identified by a client ID, will be registered, or if already existing,
will be resumed. If the session exists but is associated with an existing client,
the old client is evicted, as per the specifications.

Due to specific locking requirements around JS API requests, we cannot hold some
locks for the entire duration of processing of some protocols, therefore, we use
a map that registers the client ID in a "locked" state. If a different client tries
to connect and the server detects that the client ID is in that map, it will try
a little bit until it is not, or fail the new client, since we can't protect
processing of protocols in the original client. This is not expected to happen often.

Runs from the client's readLoop.
No lock held on entry.


name: mqttComputeNatsMsgSize
go_file: server/mqtt.go
go_method: mqttComputeNatsMsgSize
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttComputeNatsMsgSize
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
mqttComputeNatsMsgSize computes the size the NATS message to be delivered
based on a MQTT PUBLISH packet.
encodePP: whether to encode complete MQTT PUBLISH packet header information
  - false: initial delivery (QoS 0/1) needs only base header
  - true: QoS2 storage needs to encode Nmqtt-Subject and Nmqtt-Mapped


name: mqttNewDeliverableMessage
go_file: server/mqtt.go
go_method: mqttNewDeliverableMessage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttNewDeliverableMessage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Composes a NATS message from a MQTT PUBLISH packet. The message includes an
internal header containint the original packet's QoS, and for QoS2 packets
the original subject.

Example (QoS2, subject: "foo.bar"):

	NATS/1.0\r\n
	Nmqtt-Pub:2foo.bar\r\n
	\r\n


name: mqttNewDeliverablePubRel
go_file: server/mqtt.go
go_method: mqttNewDeliverablePubRel
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttNewDeliverablePubRel
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Composes a NATS message for a pending PUBREL packet. The message includes an
internal header containing the PI for PUBREL/PUBCOMP.

Example (PI:123):

		NATS/1.0\r\n
	 	Nmqtt-PubRel:123\r\n
		\r\n


name: Server.mqttProcessPubRel
go_file: server/mqtt.go
go_class: Server
go_method: mqttProcessPubRel
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttProcessPubRel
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Process a PUBREL packet (QoS2, acting as Receiver).

Runs from the client's readLoop.
No lock held on entry.


name: client.mqttHandlePubRetain
go_file: server/mqtt.go
go_class: client
go_method: mqttHandlePubRetain
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MqttHandlePubRetain
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Invoked when processing an inbound client message. If the "retain" flag is
set, the message is stored so it can be later resent to (re)starting
subscriptions that match the subject.

Invoked from the MQTT publisher's readLoop. No client lock is held on entry.


name: Server.mqttCheckPubRetainedPerms
go_file: server/mqtt.go
go_class: Server
go_method: mqttCheckPubRetainedPerms
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: MqttCheckPubRetainedPerms
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
After a config reload, it is possible that the source of a publish retained
message is no longer allowed to publish on the given topic. If that is the
case, the retained message is removed from the map and will no longer be
sent to (re)starting subscriptions.

Server lock MUST NOT be held on entry.


name: client.mqttProcessPublishReceived
go_file: server/mqtt.go
go_class: client
go_method: mqttProcessPublishReceived
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MqttProcessPublishReceived
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process a PUBACK (QoS1) or a PUBREC (QoS2) packet, acting as Sender. Set
isPubRec to false to process as a PUBACK.

Runs from the client's readLoop. No lock held on entry.


name: mqttDeliverMsgCbQoS0
go_file: server/mqtt.go
go_method: mqttDeliverMsgCbQoS0
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttDeliverMsgCbQoS0
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
For a MQTT QoS0 subscription, we create a single NATS subscription on the
actual subject, for instance "foo.bar".

For a MQTT QoS1+ subscription, we create 2 subscriptions, one on "foo.bar"
(as for QoS0, but sub.mqtt.qos will be 1 or 2), and one on the subject
"$MQTT.sub.<uid>" which is the delivery subject of the JS durable consumer
with the filter subject "$MQTT.msgs.foo.bar".

This callback delivers messages to the client as QoS0 messages, either
because: (a) they have been produced as MQTT QoS0 messages (and therefore
only this callback can receive them); (b) they are MQTT QoS1+ published
messages but this callback is for a subscription that is QoS0; or (c) the
published messages come from (other) NATS publishers on the subject.

This callback must reject a message if it is known to be a QoS1+ published
message and this is the callback for a QoS1+ subscription because in that
case, it will be handled by the other callback. This avoid getting duplicate
deliveries.


name: mqttDeliverMsgCbQoS12
go_file: server/mqtt.go
go_method: mqttDeliverMsgCbQoS12
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttDeliverMsgCbQoS12
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is the callback attached to a JS durable subscription for a MQTT QoS 1+
sub. Only JETSTREAM should be sending a message to this subject (the delivery
subject associated with the JS durable consumer), but in cluster mode, this
can be coming from a route, gw, etc... We make sure that if this is the case,
the message contains a NATS/MQTT header that indicates that this is a
published QoS1+ message.


name: mqttMustIgnoreForReservedSub
go_file: server/mqtt.go
go_method: mqttMustIgnoreForReservedSub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttMustIgnoreForReservedSub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
The MQTT Server MUST NOT match Topic Filters starting with a wildcard
character (# or +) with Topic Names beginning with a $ character, Spec
[MQTT-4.7.2-1]. We will return true if there is a violation.

Session or subMu lock must be held on entry to protect access to sub.mqtt.


name: client.mqttProcessSubs
go_file: server/mqtt.go
go_class: client
go_method: mqttProcessSubs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MqttProcessSubs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process the SUBSCRIBE packet.

Process the list of subscriptions and update the given filter
with the QoS that has been accepted (or failure).

Spec [MQTT-3.8.4-3] says that if an exact same subscription is
found, it needs to be replaced with the new one (possibly updating
the qos) and that the flow of publications must not be interrupted,
which I read as the replacement cannot be a "remove then add" if there
is a chance that in between the 2 actions, published messages
would be "lost" because there would not be any matching subscription.

Run from client's readLoop.
No lock held on entry.


name: mqttSession.cleanupFailedSub
go_file: server/mqtt.go
go_class: mqttSession
go_method: cleanupFailedSub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: CleanupFailedSub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Cleanup that is performed in processSubs if there was an error.

Runs from client's readLoop.
Lock not held on entry, but session is in the locked map.


name: mqttSession.processJSConsumer
go_file: server/mqtt.go
go_class: mqttSession
go_method: processJSConsumer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttSession
dotnet_method: ProcessJSConsumer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
When invoked with a QoS of 0, looks for an existing JS durable consumer for
the given sid and if one is found, delete the JS durable consumer and unsub
the NATS subscription on the delivery subject.

With a QoS > 0, creates or update the existing JS durable consumer along with
its NATS subscription on a delivery subject.

Session lock is acquired and released as needed. Session is in the locked
map.


name: client.mqttProcessUnsubs
go_file: server/mqtt.go
go_class: client
go_method: mqttProcessUnsubs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MqttProcessUnsubs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process the UNSUBSCRIBE packet.

Given the list of topics, this is going to unsubscribe the low level NATS subscriptions
and delete the JS durable consumers when applicable.

Runs from the client's readLoop.
No lock held on entry.


name: mqttTopicToNATSPubSubject
go_file: server/mqtt.go
go_method: mqttTopicToNATSPubSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttTopicToNATSPubSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Converts an MQTT Topic Name to a NATS Subject (used by PUBLISH)
See mqttToNATSSubjectConversion() for details.


name: mqttFilterToNATSSubject
go_file: server/mqtt.go
go_method: mqttFilterToNATSSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttFilterToNATSSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Converts an MQTT Topic Filter to a NATS Subject (used by SUBSCRIBE)
See mqttToNATSSubjectConversion() for details.


name: mqttToNATSSubjectConversion
go_file: server/mqtt.go
go_method: mqttToNATSSubjectConversion
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: MqttToNATSSubjectConversion
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Converts an MQTT Topic Name or Filter to a NATS Subject.
In MQTT:
- a Topic Name does not have wildcard (PUBLISH uses only topic names).
- a Topic Filter can include wildcards (SUBSCRIBE uses those).
- '+' and '#' are wildcard characters (single and multiple levels respectively)
- '/' is the topic level separator.

Conversion that occurs:
  - '/' is replaced with '/.' if it is the first character in mt
  - '/' is replaced with './' if the last or next character in mt is '/'
    For instance, foo//bar would become foo./.bar
  - '/' is replaced with '.' for all other conditions (foo/bar -> foo.bar)
  - '.' is replaced with '//'.
  - ' ' cause an error to be returned.

If there is no need to convert anything (say "foo" remains "foo"), then
the no memory is allocated and the returned slice is the original `mt`.


name: natsSubjectStrToMQTTTopic
go_file: server/mqtt.go
go_method: natsSubjectStrToMQTTTopic
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MqttHandler
dotnet_method: NatsSubjectStrToMQTTTopic
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Converts a NATS subject to MQTT topic. This is for publish
messages only, so there is no checking for wildcards.
Rules are reversed of mqttToNATSSubjectConversion.


name: client.isMsgTraceEnabled
go_file: server/msgtrace.go
go_class: client
go_method: isMsgTraceEnabled
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: IsMsgTraceEnabled
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns the message trace object, if message is being traced,
and `true` if we want to only trace, not actually deliver the message.


name: client.msgTraceSupport
go_file: server/msgtrace.go
go_class: client
go_method: msgTraceSupport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: MsgTraceSupport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
For LEAF/ROUTER/GATEWAY, return false if the remote does not support
message tracing (important if the tracing requests trace-only).


name: genHeaderMapIfTraceHeadersPresent
go_file: server/msgtrace.go
go_method: genHeaderMapIfTraceHeadersPresent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MessageTracer
dotnet_method: GenHeaderMapIfTraceHeadersPresent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This function will return the header as a map (instead of http.Header because
we want to preserve the header names' case) and a boolean that indicates if
the headers have been lifted due to the presence of the external trace header
only.
Note that because of the traceParentHdr, the search is done in a case
insensitive way. We used to rewrite it in lower case but no longer do since v2.14.


name: client.initAndSendIngressErrEvent
go_file: server/msgtrace.go
go_class: client
go_method: initAndSendIngressErrEvent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: InitAndSendIngressErrEvent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Special case where we create a trace event before parsing the message.
This is for cases where the connection will be closed when detecting
an error during early message processing (for instance max payload).


name: msgTrace.traceOnly
go_file: server/msgtrace.go
go_class: msgTrace
go_method: traceOnly
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MsgTrace
dotnet_method: TraceOnly
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns `true` if message tracing is enabled and we are tracing only,
that is, we are not going to deliver the inbound message, returns
`false` otherwise (no tracing, or tracing and message delivery).


name: Server.NonceRequired
description: NonceRequired tells us if we should send a nonce.
go_file: server/nkey.go
go_class: Server
go_method: NonceRequired
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NonceRequired
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
notes:
Server struct methods — will be ported as part of Server class in session 09; nonce generation belongs in auth/handshake flow


name: Server.NewOCSPMonitor
go_file: server/ocsp.go
go_class: Server
go_method: NewOCSPMonitor
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NewOCSPMonitor
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
NewOCSPMonitor takes a TLS configuration then wraps it with the callbacks set for OCSP verification
along with a monitor that will periodically fetch OCSP staples.


name: OCSPMonitor.writeOCSPStatus
go_file: server/ocsp.go
go_class: OCSPMonitor
go_method: writeOCSPStatus
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: OcspMonitor
dotnet_method: WriteOCSPStatus
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
writeOCSPStatus writes an OCSP status to a temporary file then moves it to a
new path, in an attempt to avoid corrupting existing data.


name: getOCSPIssuer
go_file: server/ocsp.go
go_method: getOCSPIssuer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: OcspHandler
dotnet_method: GetOCSPIssuer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
getOCSPIssuer determines an issuer certificate from the cert (bundle) or the file-based CA trust store


name: Server.plugTLSOCSPPeer
go_file: server/ocsp_peer.go
go_class: Server
go_method: plugTLSOCSPPeer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: PlugTLSOCSPPeer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
plugTLSOCSPPeer will plug the TLS handshake lifecycle for client mTLS connections and Leaf connections


name: Server.tlsServerOCSPValid
go_file: server/ocsp_peer.go
go_class: Server
go_method: tlsServerOCSPValid
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: TlsServerOCSPValid
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
tlsServerOCSPValid evaluates verified chains (post successful TLS handshake) against OCSP
eligibility. A verified chain is considered OCSP Valid if either none of the links are
OCSP eligible, or current "good" responses from the CA can be obtained for each eligible link.
Upon first OCSP Valid chain found, the Server is deemed OCSP Valid. If none of the chains are
OCSP Valid, the Server is deemed OCSP Invalid. A verified self-signed certificate (chain length 1)
is also considered OCSP Valid.


name: Server.tlsClientOCSPValid
go_file: server/ocsp_peer.go
go_class: Server
go_method: tlsClientOCSPValid
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: TlsClientOCSPValid
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
tlsClientOCSPValid evaluates verified chains (post successful TLS handshake) against OCSP
eligibility. A verified chain is considered OCSP Valid if either none of the links are
OCSP eligible, or current "good" responses from the CA can be obtained for each eligible link.
Upon first OCSP Valid chain found, the Client is deemed OCSP Valid. If none of the chains are
OCSP Valid, the Client is deemed OCSP Invalid. A verified self-signed certificate (chain length 1)
is also considered OCSP Valid.


name: LocalCache.Delete
go_file: server/ocsp_responsecache.go
go_class: LocalCache
go_method: Delete
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: LocalDirCache
dotnet_method: Delete
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Delete removes a CA OCSP response from the OCSP peer cache matching the response fingerprint (a hash)


name: LocalCache.Start
go_file: server/ocsp_responsecache.go
go_class: LocalCache
go_method: Start
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: LocalDirCache
dotnet_method: Start
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Start initializes the configured OCSP peer cache, loads a saved cache from disk (if present), and initializes runtime statistics


name: NoErrOnUnknownFields
go_file: server/opts.go
go_method: NoErrOnUnknownFields
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: NoErrOnUnknownFields
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
NoErrOnUnknownFields can be used to change the behavior the processing
of a configuration file. By default, an error is reported if unknown
fields are found. If `noError` is set to true, no error will be reported
if top-level unknown fields are found.


name: unwrapValue
go_file: server/opts.go
go_method: unwrapValue
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: UnwrapValue
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
unwrapValue can be used to get the token and value from an item
to be able to report the line number in case of an incorrect
configuration.
also stores the token in lastToken for use in convertPanicToError


name: Options.ProcessConfigFile
go_file: server/opts.go
go_class: Options
go_method: ProcessConfigFile
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ProcessConfigFileOverload2510
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ProcessConfigFile updates the Options structure with options
present in the given configuration file.
This version is convenient if one wants to set some default
options and then override them with what is in the config file.
For instance, this version allows you to do something such as:

opts := &Options{Debug: true}
opts.ProcessConfigFile(myConfigFile)

If the config file contains "debug: false", after this call,
opts.Debug would really be false. It would be impossible to
achieve that with the non receiver ProcessConfigFile() version,
since one would not know after the call if "debug" was not present
or was present but set to false.


name: Options.ProcessConfigString
go_file: server/opts.go
go_class: Options
go_method: ProcessConfigString
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ProcessConfigString
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ProcessConfigString is the same as ProcessConfigFile, but expects the
contents of the config file to be passed in rather than the file name.


name: parseCompression
go_file: server/opts.go
go_method: parseCompression
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ParseCompression
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
The parameter `chosenModeForOn` indicates which compression mode to use
when the user selects "on" (or enabled, true, etc..). This is because
we may have different defaults depending on where the compression is used.


name: parseJetStreamForAccount
go_file: server/opts.go
go_method: parseJetStreamForAccount
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ParseJetStreamForAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Parses jetstream account limits for an account. Simple setup with boolen is allowed, and we will
use dynamic account limits.


name: parseLeafUsers
go_file: server/opts.go
go_method: parseLeafUsers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ParseLeafUsers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is a trimmed down version of parseUsers that is adapted
for the users possibly defined in the authorization{} section
of leafnodes {}.


name: parseExportStreamOrService
go_file: server/opts.go
go_method: parseExportStreamOrService
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ParseExportStreamOrService
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Parse an export stream or service.
e.g.
{stream: "public.>"} # No accounts means public.
{stream: "synadia.private.>", accounts: [cncf, natsio]}
{service: "pub.request"} # No accounts means public.
{service: "pub.special.request", accounts: [nats.io]}


name: parseImportStreamOrService
go_file: server/opts.go
go_method: parseImportStreamOrService
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ParseImportStreamOrService
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Parse an import stream or service.
e.g.
{stream: {account: "synadia", subject:"public.synadia"}, prefix: "imports.synadia"}
{stream: {account: "synadia", subject:"synadia.private.*"}}
{service: {account: "synadia", subject: "pub.special.request"}, to: "synadia.request"}


name: ConfigureOptions
go_file: server/opts.go
go_method: ConfigureOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: ConfigureOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ConfigureOptions accepts a flag set and augments it with NATS Server
specific flags. On success, an options structure is returned configured
based on the selected flags and/or configuration file.
The command line options take precedence to the ones in the configuration file.


name: overrideCluster
go_file: server/opts.go
go_method: overrideCluster
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: OverrideCluster
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
overrideCluster updates Options.Cluster if that flag "cluster" (or "cluster_listen")
has explicitly be set in the command line. If it is set to empty string, it will
clear the Cluster options.


name: maybeReadPidFile
go_file: server/opts.go
go_method: maybeReadPidFile
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerOptions
dotnet_method: MaybeReadPidFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
maybeReadPidFile returns a PID or Windows service name obtained via the following method:
1. Try to open a file with path "pidStr" (absolute or relative).
2. If such a file exists and can be read, return its contents.
3. Otherwise, return the original "pidStr" string.


name: client.overMaxControlLineLimit
go_file: server/parser.go
go_class: client
go_method: overMaxControlLineLimit
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: OverMaxControlLineLimit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:05:38
description:
Check if the length of buffer `arg` is over the max control line limit `mcl`.
If so, an error is sent to the client and the connection is closed.
The error ErrMaxControlLine is returned.


name: client.clonePubArg
go_file: server/parser.go
go_class: client
go_method: clonePubArg
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ClonePubArg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:05:38
description:
clonePubArg is used when the split buffer scenario has the pubArg in the existing read buffer, but
we need to hold onto it into the next read.


name: Server.initRaftNode
go_file: server/raft.go
go_class: Server
go_method: initRaftNode
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InitRaftNode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
initRaftNode will initialize the raft node, to be used by startRaftNode or when testing to not run the Go routine.


name: raft.checkAccountNRGStatus
go_file: server/raft.go
go_class: raft
go_method: checkAccountNRGStatus
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: CheckAccountNRGStatus
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns whether peers within this group claim to support
moving NRG traffic into the asset account.
Lock must be held.


name: Server.lookupRaftNode
go_file: server/raft.go
go_class: Server
go_method: lookupRaftNode
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LookupRaftNode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Finds the Raft node for a given Raft group, if any. If there is no Raft node
running for this group then it can return nil.


name: Server.reloadDebugRaftNodes
go_file: server/raft.go
go_class: Server
go_method: reloadDebugRaftNodes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReloadDebugRaftNodes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Reloads the debug state for all running Raft nodes. This is necessary when
the configuration has been reloaded and the debug log level has changed.


name: Server.stepdownRaftNodes
go_file: server/raft.go
go_class: Server
go_method: stepdownRaftNodes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StepdownRaftNodes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Requests that all Raft nodes on this server step down and place them into
observer mode. This is called when the server is shutting down.


name: Server.shutdownRaftNodes
go_file: server/raft.go
go_class: Server
go_method: shutdownRaftNodes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ShutdownRaftNodes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Shuts down all Raft nodes on this server. This is called either when the
server is either entering lame duck mode, shutting down or when JetStream
has been disabled.


name: Server.transferRaftLeaders
go_file: server/raft.go
go_class: Server
go_method: transferRaftLeaders
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: TransferRaftLeaders
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used in lameduck mode to move off the leaders.
We also put all nodes in observer mode so new leaders
can not be placed on this server.


name: raft.ForwardProposal
go_file: server/raft.go
go_class: raft
go_method: ForwardProposal
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ForwardProposal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
ForwardProposal will forward the proposal to the leader if known.
If we are the leader this is the same as calling propose.


name: raft.AdjustBootClusterSize
go_file: server/raft.go
go_class: raft
go_method: AdjustBootClusterSize
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: AdjustBootClusterSize
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
AdjustBootClusterSize can be called to adjust the boot cluster size.
Will error if called on a group with a leader or a previous leader.
This can be helpful in mixed mode.


name: raft.PauseApply
go_file: server/raft.go
go_class: raft
go_method: PauseApply
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: PauseApply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
PauseApply will allow us to pause processing of append entries onto our
external apply queue. In effect this means that the upper layer will no longer
receive any new entries from the Raft group.


name: raft.ResumeApply
go_file: server/raft.go
go_class: raft
go_method: ResumeApply
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ResumeApply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
ResumeApply will resume sending applies to the external apply queue. This
means that we will start sending new entries to the upper layer.


name: raft.DrainAndReplaySnapshot
go_file: server/raft.go
go_class: raft
go_method: DrainAndReplaySnapshot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: DrainAndReplaySnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
DrainAndReplaySnapshot will drain the apply queue and replay the snapshot.
Our highest known commit will be preserved by pausing applies. The caller
should make sure to call ResumeApply() when handling the snapshot from the
queue, which will populate the rest of the committed entries in the queue.


name: raft.Applied
go_file: server/raft.go
go_class: raft
go_method: Applied
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: Applied
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
Applied is a callback that must be called by the upper layer when it
has successfully applied the committed entries that it received from the
apply queue. It will return the number of entries and an estimation of the
byte size that could be removed with a snapshot/compact.


name: raft.Processed
go_file: server/raft.go
go_class: raft
go_method: Processed
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: Processed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
Processed is a callback that must be called by the upper layer when it
has processed the committed entries that it received from the apply queue,
but it (maybe) hasn't applied all the processed entries yet.
Used to indicate a commit was processed, even if it wasn't applied yet and
can't be compacted away by a snapshot just yet. Which allows us to try to
become leader if we've processed all commits, even if they're not all applied.


name: raft.SendSnapshot
go_file: server/raft.go
go_class: raft
go_method: SendSnapshot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: SendSnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
SendSnapshot will send the latest snapshot as a normal AE.
Should only be used when the upper layers know this is most recent.
Used when restoring streams, moving a stream from R1 to R>1, etc.


name: raft.InstallSnapshot
go_file: server/raft.go
go_class: raft
go_method: InstallSnapshot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: InstallSnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
Used to install a snapshot for the given term and applied index. This will release
all of the log entries up to and including index. This should not be called with
entries that have been applied to the FSM but have not been applied to the raft state.


name: raft.CreateSnapshotCheckpoint
go_file: server/raft.go
go_class: raft
go_method: CreateSnapshotCheckpoint
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: CreateSnapshotCheckpoint
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
CreateSnapshotCheckpoint creates a checkpoint to allow installing a snapshot asynchronously.
Caller MUST make sure it only ever has one checkpoint handle at most, and either installs or
aborts the checkpoint.
See also: RaftNodeCheckpoint


name: checkpoint.InstallSnapshot
go_file: server/raft.go
go_class: checkpoint
go_method: InstallSnapshot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Checkpoint
dotnet_method: InstallSnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
InstallSnapshot allows asynchronous installation of a snapshot by unlocking when
performing operations that don't strictly need to be locked. When the lock is re-acquired
n.snapshotting will be checked to ensure we're still meant to.
Async snapshots can only be used when using CreateSnapshotCheckpoint.
Lock should be held.


name: raft.NeedSnapshot
go_file: server/raft.go
go_class: raft
go_method: NeedSnapshot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: NeedSnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
NeedSnapshot returns true if it is necessary to try to install a snapshot, i.e.
after we have finished recovering/replaying at startup, on a regular interval or
as a part of cleaning up when shutting down.


name: termAndIndexFromSnapFile
go_file: server/raft.go
go_method: termAndIndexFromSnapFile
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: TermAndIndexFromSnapFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
termAndIndexFromSnapfile tries to load the snapshot file and returns the term
and index from that snapshot.


name: raft.setupLastSnapshot
go_file: server/raft.go
go_class: raft
go_method: setupLastSnapshot
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: SetupLastSnapshot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
setupLastSnapshot is called at startup to try and recover the last snapshot from
the disk if possible. We will try to recover the term, index and commit/applied
indices and then notify the upper layer what we found. Compacts the WAL if needed.


name: raft.Leader
go_file: server/raft.go
go_class: raft
go_method: Leader
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: Leader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
Leader returns if we are the leader for our group.
We use an atomic here now vs acquiring the read lock.


name: raft.stepdown
go_file: server/raft.go
go_class: raft
go_method: stepdown
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: Stepdown
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
stepdown immediately steps down the Raft node to the
follower state. This will take the lock itself.


name: raft.stepdownLocked
go_file: server/raft.go
go_class: raft
go_method: stepdownLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: StepdownLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
stepdownLocked immediately steps down the Raft node to the
follower state. This requires the lock is already held.


name: raft.isCurrent
go_file: server/raft.go
go_class: raft
go_method: isCurrent
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: IsCurrent
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
isCurrent is called from the healthchecks and returns true if we believe
that the upper layer is current with the Raft layer, i.e. that it has applied
all of the commits that we have given it.
Optionally we can also check whether or not we're making forward progress if we
aren't current, in which case this function may block for up to ~10ms to find out.
Lock should be held.


name: raft.Leaderless
go_file: server/raft.go
go_class: raft
go_method: Leaderless
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: Leaderless
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
Leaderless is a lockless way of finding out if the group has a
leader or not. Use instead of GroupLeader in hot paths.


name: raft.State
go_file: server/raft.go
go_class: raft
go_method: State
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: State
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:28
description:
State returns the current state for this node.
Upper layers should not check State to check if we're Leader, use n.Leader() instead.


name: raft.run
go_file: server/raft.go
go_class: raft
go_method: run
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: Run
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
run is the top-level runner for the Raft state machine. Depending on the
state of the node (leader, follower, candidate, observer), this will call
through to other functions. It is expected that this function will run for
the entire life of the Raft node once started.


name: raft.processAppendEntries
go_file: server/raft.go
go_class: raft
go_method: processAppendEntries
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ProcessAppendEntries
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processAppendEntries is called by the Raft state machine when there are
new append entries to be committed and sent to the upper state machine.


name: raft.runAsFollower
go_file: server/raft.go
go_class: raft
go_method: runAsFollower
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: RunAsFollower
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
runAsFollower is called by run and will block for as long as the node is
running in the follower state.


name: newCommittedEntry
go_file: server/raft.go
go_method: newCommittedEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: NewCommittedEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Create a new CommittedEntry. When the returned entry is no longer needed, it
should be returned to the pool by calling ReturnToPool.


name: CommittedEntry.ReturnToPool
go_file: server/raft.go
go_class: CommittedEntry
go_method: ReturnToPool
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: CommittedEntry
dotnet_method: ReturnToPool
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ReturnToPool returns the CommittedEntry to the pool, after which point it is
no longer safe to reuse.


name: newEntry
go_file: server/raft.go
go_method: newEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: NewEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Helper to create new entries. When the returned entry is no longer needed, it
should be returned to the entryPool pool.


name: raft.addPeer
go_file: server/raft.go
go_class: raft
go_method: addPeer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: AddPeer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Adds peer with the given id to our membership,
and adjusts cluster size and quorum accordingly.
Lock should be held.


name: raft.removePeer
go_file: server/raft.go
go_class: raft
go_method: removePeer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: RemovePeer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Remove the peer with the given id from our membership,
and adjusts cluster size and quorum accordingly.
Lock should be held.


name: raft.sendMembershipChange
go_file: server/raft.go
go_class: raft
go_method: sendMembershipChange
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: SendMembershipChange
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Build and send appendEntry request for the given entry that changes
membership (EntryAddPeer / EntryRemovePeer).
Returns true if the entry made it to the WAL and was sent to the followers


name: raft.notActive
go_file: server/raft.go
go_class: raft
go_method: notActive
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: NotActive
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check for being not active in terms of sending entries.
Used in determining if we need to send a heartbeat.


name: raft.applyCommit
go_file: server/raft.go
go_class: raft
go_method: applyCommit
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ApplyCommit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
applyCommit will update our commit index and apply the entry to the apply queue.
lock should be held.


name: raft.tryCommit
go_file: server/raft.go
go_class: raft
go_method: tryCommit
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: TryCommit
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Check if there is a quorum for the given index, and if
so, commit the corresponding entry.
Return true if the index was committed, false otherwise.
Lock should be held.


name: raft.trackResponse
go_file: server/raft.go
go_class: raft
go_method: trackResponse
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: TrackResponse
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Used to track a success response. Returns true if the
response was tracked, false if the response was ignored
(the response is old, the index is already committed, ...)
Lock should be held.


name: raft.handleAppendEntry
go_file: server/raft.go
go_class: raft
go_method: handleAppendEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: HandleAppendEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
handleAppendEntry handles an append entry from the wire. This function
is an internal callback from the "asubj" append entry subscription.


name: raft.cancelCatchup
go_file: server/raft.go
go_class: raft
go_method: cancelCatchup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: CancelCatchup
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
cancelCatchup will stop an in-flight catchup by unsubscribing from the
catchup subscription.
Lock should be held.


name: raft.catchupStalled
go_file: server/raft.go
go_class: raft
go_method: catchupStalled
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: CatchupStalled
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
catchupStalled will try to determine if we are stalled. This is called
on a new entry from our leader.
Lock should be held.


name: raft.createCatchup
go_file: server/raft.go
go_class: raft
go_method: createCatchup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: CreateCatchup
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
createCatchup will create the state needed to track a catchup as it
runs. It then creates a unique inbox for this catchup and subscribes
to it. The remote side will stream entries to that subject.
Lock should be held.


name: raft.processAppendEntry
go_file: server/raft.go
go_class: raft
go_method: processAppendEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ProcessAppendEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processAppendEntry will process an appendEntry. This is called either
during recovery or from processAppendEntries when there are new entries
to be committed.


name: raft.resetInitializing
go_file: server/raft.go
go_class: raft
go_method: resetInitializing
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ResetInitializing
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
resetInitializing resets the notion of initializing.
If we were scaling up, also leaves observer mode.
Lock should be held.


name: raft.processPeerState
go_file: server/raft.go
go_class: raft
go_method: processPeerState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ProcessPeerState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processPeerState is called when a peer state entry is received
over the wire or when we're updating known peers.
Lock should be held.


name: raft.processAppendEntryResponse
go_file: server/raft.go
go_class: raft
go_method: processAppendEntryResponse
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ProcessAppendEntryResponse
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
processAppendEntryResponse is called when we receive an append entry
response from another node. They will send a confirmation to tell us
whether they successfully committed the entry or not.


name: raft.cachePendingEntry
go_file: server/raft.go
go_class: raft
go_method: cachePendingEntry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: CachePendingEntry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
cachePendingEntry saves append entries in memory for faster processing during applyCommit.
Only save so many however to avoid memory bloat.


name: raft.readTermVote
go_file: server/raft.go
go_class: raft
go_method: readTermVote
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: ReadTermVote
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
readTermVote will read the largest term and who we voted from to stable storage.
Lock should be held.


name: raft.writeTermVote
go_file: server/raft.go
go_class: raft
go_method: writeTermVote
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: IRaftNode
dotnet_method: WriteTermVoteInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
writeTermVote will record the largest term and who we voted for to stable storage.
Lock should be held.


name: debugOption.Apply
go_file: server/reload.go
go_class: debugOption
go_method: Apply
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: DebugReloadOption
dotnet_method: Apply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Apply is mostly a no-op because logging will be reloaded after options are applied.
However we will kick the raft nodes if they exist to reload.


name: maxConnOption.Apply
go_file: server/reload.go
go_class: maxConnOption
go_method: Apply
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: MaxConnReloadOption
dotnet_method: Apply
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Apply the max connections change by closing random connections til we are
below the limit if necessary.


name: Server.recheckPinnedCerts
go_file: server/reload.go
go_class: Server
go_method: recheckPinnedCerts
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RecheckPinnedCerts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Compares options and disconnects clients that are no longer listed in pinned certs. Lock must not be held.


name: Server.Reload
go_file: server/reload.go
go_class: Server
go_method: Reload
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: Reload
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Reload reads the current configuration file and calls out to ReloadOptions
to apply the changes. This returns an error if the server was not started
with a config file or an option which doesn't support hot-swapping was changed.


name: Server.ReloadOptions
go_file: server/reload.go
go_class: Server
go_method: ReloadOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReloadOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ReloadOptions applies any supported options from the provided Options
type. This returns an error if an option which doesn't support
hot-swapping was changed.
The provided Options type should not be re-used afterwards.
Either use Options.Clone() to pass a copy, or make a new one.


name: Server.reloadOptions
go_file: server/reload.go
go_class: Server
go_method: reloadOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReloadOptionsInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
reloadOptions reloads the server config with the provided options. If an
option that doesn't support hot-swapping is changed, this returns an error.


name: Server.diffOptions
go_file: server/reload.go
go_class: Server
go_method: diffOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: DiffOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
diffOptions returns a slice containing options which have been changed. If
an option that doesn't support hot-swapping is changed, this returns an
error.


name: Server.reloadAuthorization
go_file: server/reload.go
go_class: Server
go_method: reloadAuthorization
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReloadAuthorization
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
reloadAuthorization reconfigures the server authorization settings,
disconnects any clients who are no longer authorized, and removes any
unauthorized subscriptions.


name: Server.clientHasMovedToDifferentAccount
go_file: server/reload.go
go_class: Server
go_method: clientHasMovedToDifferentAccount
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ClientHasMovedToDifferentAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true if given client current account has changed (or user
no longer exist) in the new config, false if the user did not
change accounts.
Server lock is held on entry.


name: Server.reloadClusterPermissions
go_file: server/reload.go
go_class: Server
go_method: reloadClusterPermissions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReloadClusterPermissions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
reloadClusterPermissions reconfigures the cluster's permssions
and set the permissions to all existing routes, sending an
update INFO protocol so that remote can resend their local
subs if needed, and sending local subs matching cluster's
import subjects.


name: validateClusterOpts
go_file: server/reload.go
go_method: validateClusterOpts
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ConfigReloader
dotnet_method: ValidateClusterOpts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
validateClusterOpts ensures the new ClusterOpts does not change some of the
fields that do not support reload.


name: diffRoutes
go_file: server/reload.go
go_method: diffRoutes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ConfigReloader
dotnet_method: DiffRoutes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
diffRoutes diffs the old routes and the new routes and returns the ones that
should be added and removed from the server.


name: closedRingBuffer.closedClients
go_file: server/ring.go
go_class: closedRingBuffer
go_method: closedClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClosedRingBuffer,ClosedClient
dotnet_method: ClosedClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will return a sorted copy of the list which recipient can
modify. If the contents of the client itself need to be modified,
meaning swapping in any optional items, a copy should be made. We
could introduce a new lock and hold that but since we return this
list inside monitor which allows programatic access, we do not
know when it would be done.


name: client.processRoutedOriginClusterMsgArgs
go_file: server/route.go
go_class: client
go_method: processRoutedOriginClusterMsgArgs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: ProcessRoutedOriginClusterMsgArgs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Process an inbound LMSG specification from the remote route. This means
we have an origin cluster and we force header semantics.


name: computeRoutePoolIdx
go_file: server/route.go
go_method: computeRoutePoolIdx
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: RouteHandler
dotnet_method: ComputeRoutePoolIdx
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns a route pool index for this account based on the given pool size.
If `poolSize` is smaller or equal to 1, the returned value will always
be 0, regardless of the account name. If not, the returned value will
be in the range [0..poolSize-1]. The value for a given account name
is constant and same on all servers (given the same `poolSize` value).


name: Server.updateRemoteRoutePerms
go_file: server/route.go
go_class: Server
go_method: updateRemoteRoutePerms
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateRemoteRoutePerms
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Possibly sends local subscriptions interest to this route
based on changes in the remote's Export permissions.


name: Server.sendAsyncInfoToClients
go_file: server/route.go
go_class: Server
go_method: sendAsyncInfoToClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendAsyncInfoToClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
sendAsyncInfoToClients sends an INFO protocol to all
connected clients that accept async INFO updates.
The server lock is held on entry.


name: Server.processImplicitRoute
go_file: server/route.go
go_class: Server
go_method: processImplicitRoute
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessImplicitRoute
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will process implicit route information received from another server.
We will check to see if we have configured or are already connected,
and if so we will ignore. Otherwise we will attempt to connect.


name: Server.hasThisRouteConfigured
go_file: server/route.go
go_class: Server
go_method: hasThisRouteConfigured
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: HasThisRouteConfigured
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
hasThisRouteConfigured returns true if info.Host:info.Port is present
in the server's opts.Routes, false otherwise.
Server lock is assumed to be held by caller.


name: Server.forwardNewRouteInfoToKnownServers
go_file: server/route.go
go_class: Server
go_method: forwardNewRouteInfoToKnownServers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ForwardNewRouteInfoToKnownServers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
forwardNewRouteInfoToKnownServers possibly sends the INFO protocol of the
new route to all routes known by this server. In turn, each server will
contact this new route.
Server lock held on entry.


name: client.canImport
go_file: server/route.go
go_class: client
go_method: canImport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: CanImport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
canImport is whether or not we will send a SUB for interest to the other side.
This is for ROUTER connections only.
Lock is held on entry.


name: client.canExport
go_file: server/route.go
go_class: client
go_method: canExport
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: CanExport
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
canExport is whether or not we will accept a SUB from the remote for a given subject.
This is for ROUTER connections only.
Lock is held on entry


name: client.setRoutePermissions
go_file: server/route.go
go_class: client
go_method: setRoutePermissions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SetRoutePermissions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Initialize or reset cluster's permissions.
This is for ROUTER connections only.
Client lock is held on entry


name: getAccNameFromRoutedSubKey
go_file: server/route.go
go_method: getAccNameFromRoutedSubKey
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: RouteHandler
dotnet_method: GetAccNameFromRoutedSubKey
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the account name from the subscription's key.
This is invoked knowing that the key contains an account name, so for a sub
that is not from a pinned-account route.
The `keyHasSubType` boolean indicates that the key starts with the indicator
for leaf or regular routed subscriptions.


name: client.getRoutedSubKeyInfo
go_file: server/route.go
go_class: client
go_method: getRoutedSubKeyInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: GetRoutedSubKeyInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns if the route is dedicated to an account, its name, and a boolean
that indicates if this route uses the routed subscription indicator at
the beginning of the subscription key.
Lock held on entry.


name: client.removeRemoteSubsForAcc
go_file: server/route.go
go_class: client
go_method: removeRemoteSubsForAcc
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: RemoveRemoteSubsForAcc
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Removes (and returns) the subscriptions from this route's subscriptions map
that belong to the given account.
Lock is held on entry


name: Server.sendSubsToRoute
go_file: server/route.go
go_class: Server
go_method: sendSubsToRoute
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendSubsToRoute
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
sendSubsToRoute will send over our subject interest to
the remote side. For each account we will send the
complete interest for all subjects, both normal as a binary
and queue group weights.

Server lock held on entry.


name: client.sendRouteSubProtos
go_file: server/route.go
go_class: client
go_method: sendRouteSubProtos
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendRouteSubProtos
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Sends SUBs protocols for the given subscriptions. If a filter is specified, it is
invoked for each subscription. If the filter returns false, the subscription is skipped.
This function may release the route's lock due to flushing of outbound data. A boolean
is returned to indicate if the connection has been closed during this call.
Lock is held on entry.


name: client.sendRouteUnSubProtos
go_file: server/route.go
go_class: client
go_method: sendRouteUnSubProtos
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendRouteUnSubProtos
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Sends UNSUBs protocols for the given subscriptions. If a filter is specified, it is
invoked for each subscription. If the filter returns false, the subscription is skipped.
This function may release the route's lock due to flushing of outbound data. A boolean
is returned to indicate if the connection has been closed during this call.
Lock is held on entry.


name: client.sendRouteSubOrUnSubProtos
go_file: server/route.go
go_class: client
go_method: sendRouteSubOrUnSubProtos
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: SendRouteSubOrUnSubProtos
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Low-level function that sends RS+ or RS- protocols for the given subscriptions.
This can now also send LS+ and LS- for origin cluster based leafnode subscriptions for cluster no-echo.
Use sendRouteSubProtos or sendRouteUnSubProtos instead for clarity.
Lock is held on entry.


name: Server.generateRouteInitialInfoJSON
go_file: server/route.go
go_class: Server
go_method: generateRouteInitialInfoJSON
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GenerateRouteInitialInfoJSON
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Generates a nonce and set some route info's fields before marshal'ing into JSON.
To be used only when a route is created (to send the initial INFO protocol).

Server lock held on entry.


name: Server.updateRouteSubscriptionMap
go_file: server/route.go
go_class: Server
go_method: updateRouteSubscriptionMap
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateRouteSubscriptionMap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
updateRouteSubscriptionMap will make sure to update the route map for the subscription. Will
also forward to all routes if needed.


name: Server.startRouteAcceptLoop
go_file: server/route.go
go_class: Server
go_method: startRouteAcceptLoop
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StartRouteAcceptLoop
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This starts the route accept loop in a go routine, unless it
is detected that the server has already been shutdown.
It will also start soliciting explicit routes.


name: Server.StartRouting
go_file: server/route.go
go_class: Server
go_method: StartRouting
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: StartRouting
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
StartRouting will start the accept loop on the cluster host:port
and will actively try to connect to listed routes.


name: Server.saveRouteTLSName
go_file: server/route.go
go_class: Server
go_method: saveRouteTLSName
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SaveRouteTLSName
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Save the first hostname found in route URLs. This will be used in gossip mode
when trying to create a TLS connection by setting the tlsConfig.ServerName.
Lock is held on entry


name: Server.solicitRoutes
go_file: server/route.go
go_class: Server
go_method: solicitRoutes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SolicitRoutes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Start connection process to provided routes. Each route connection will
be started in a dedicated go routine.
Lock is held on entry


name: Server.forEachNonPerAccountRoute
go_file: server/route.go
go_class: Server
go_method: forEachNonPerAccountRoute
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ForEachNonPerAccountRoute
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Goes over each non-nil route connection for all remote servers
and invokes the function `f`. It does not go over per-account
routes.
Server lock is held on entry.


name: Server.forEachRoute
go_file: server/route.go
go_class: Server
go_method: forEachRoute
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ForEachRoute
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Goes over each non-nil route connection for all remote servers
and invokes the function `f`. This also includes the per-account
routes.
Server lock is held on entry.


name: Server.forEachRouteIdx
go_file: server/route.go
go_class: Server
go_method: forEachRouteIdx
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ForEachRouteIdx
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Goes over each non-nil route connection at the given pool index
location in the slice and invokes the function `f`. If the
callback returns `true`, this function moves to the next remote.
Otherwise, the iteration over removes stops.
This does not include per-account routes.
Server lock is held on entry.


name: Server.forEachRemote
go_file: server/route.go
go_class: Server
go_method: forEachRemote
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ForEachRemote
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:49:47
description:
Goes over each remote and for the first non nil route connection,
invokes the function `f`.
Server lock is held on entry.


name: MsgScheduling.encode
go_file: server/scheduler.go
go_class: MsgScheduling
go_method: encode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Scheduler
dotnet_method: Encode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:00:54
description:
encode writes out the contents of the schedule into a binary snapshot
and returns it. The high seq number is included in the snapshot and will
be returned on decode.


name: MsgScheduling.decode
go_file: server/scheduler.go
go_class: MsgScheduling
go_method: decode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Scheduler
dotnet_method: Decode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:00:54
description:
decode snapshots a binary-encoded schedule and replaces the contents of this
schedule with them. Returns the high seq number from the snapshot.


