You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to aggregate JetStream advisory events from multiple accounts on one aggregate account. This would allow nats-surveyor to maintain a single connection with the server to gather JetStream advisory metrics from multiple accounts.
On JetStream events, server publishes messages on $JS.EVENT.ADVISORY.> in account A.
Account AGG exports a service with account_token_position on which the advisory events should be forwarded
All advosory messages from account A should be available on $JS.EVENT.ADVISORY.ACC.A.>
Actual behavior
Advisory events published on subjects other than $JS.EVENT.ADVISORY.API (e.g. $JS.EVENT.ADVISORY.STREAM.CREATED.ORDERS) are mapped correctly and available on account AGG. Messages published on $JS.EVENT.ADVISORY.API (the audit messages) are not available on AGG.
Additional information
Behavior is the same whether or not mapping is used, e.g. exporting $JS.EVENT.> -> $JS.EVENT.> does not fix the issue
Intended behavior can be achieved using stream export from account A to account AGG and in that case it works fine (I can subscribe on $JS.EVENT.ADVOSORY.ACC.A.> and all events are available. However, using service exports would be a desirable solution since with services I can utilize account_token_position and have a single export on account AGG instead of an import per account.
The same behavior is present when attempting to export service latency subjects (which also uses sendInternalAccountMsg())
I am not sure whether this behavior is intentional or not, but seems to be inconsistent given it differs depending on whether stream export or service export is used.
I added a test to show the issue: 3b19e16
The first test (TestJetStreamAccountImportJSAdvisoriesAsService) uses service exports (and fails) and the second uses stream exports (which succeeds). Both tests have the same scenario:
On account JS, subscribe to $JS.EVENT.ADVISORY.>
On account AGG, subscribe to $JS.EVENT.ADVISORY.ACC.JS.>
Create a stream on account JS
Expect two messages on both subscriptions:
an action event on $JS.EVENT.ADVISORY.STREAM.CREATED.ORDERS
an api audit event on $JS.EVENT.ADVISORY.API
The text was updated successfully, but these errors were encountered:
Use case:
I want to aggregate JetStream advisory events from multiple accounts on one aggregate account. This would allow
nats-surveyor
to maintain a single connection with the server to gather JetStream advisory metrics from multiple accounts.I have the following config:
Intended behavior
$JS.EVENT.ADVISORY.>
in accountA
.AGG
exports a service withaccount_token_position
on which the advisory events should be forwardedA
should be available on$JS.EVENT.ADVISORY.ACC.A.>
Actual behavior
Advisory events published on subjects other than
$JS.EVENT.ADVISORY.API
(e.g.$JS.EVENT.ADVISORY.STREAM.CREATED.ORDERS
) are mapped correctly and available on accountAGG
. Messages published on$JS.EVENT.ADVISORY.API
(the audit messages) are not available onAGG
.Additional information
$JS.EVENT.>
->$JS.EVENT.>
does not fix the issueA
to accountAGG
and in that case it works fine (I can subscribe on$JS.EVENT.ADVOSORY.ACC.A.>
and all events are available. However, using service exports would be a desirable solution since with services I can utilizeaccount_token_position
and have a single export on accountAGG
instead of an import per account.Server.sendInternalAccountMsg()
(those are not forwarded) - https://github.com/nats-io/nats-server/blob/main/server/jetstream_api.go#L4332C29-L4332C29sendInternalAccountMsg()
)I added a test to show the issue: 3b19e16
The first test (
TestJetStreamAccountImportJSAdvisoriesAsService
) uses service exports (and fails) and the second uses stream exports (which succeeds). Both tests have the same scenario:JS
, subscribe to$JS.EVENT.ADVISORY.>
AGG
, subscribe to$JS.EVENT.ADVISORY.ACC.JS.>
JS
$JS.EVENT.ADVISORY.STREAM.CREATED.ORDERS
$JS.EVENT.ADVISORY.API
The text was updated successfully, but these errors were encountered: