Skip to content

Commit 15274b6

Browse files
WIP: TODO service imports handling
Signed-off-by: Maurice van Veen <[email protected]>
1 parent ff2503f commit 15274b6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

server/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,6 +4715,10 @@ func (c *client) processServiceImport(si *serviceImport, acc *Account, msg []byt
47154715
}
47164716
} else if c.kind != LEAF || c.pa.hdr < 0 || len(sliceHeader(ClientInfoHdr, msg[:c.pa.hdr])) == 0 {
47174717
ci = c.getClientInfo(share)
4718+
// FIXME(mvv): fast batch requires the original subject, test for various topologies (acc bounds, leaf, gateway)
4719+
if bytes.HasSuffix(c.pa.reply, []byte(FastBatchSuffix)) {
4720+
ci.Reply = bytesToString(c.pa.reply)
4721+
}
47184722
// If we did not share but the imports destination is the system account add in the server and cluster info.
47194723
if !share && isSysImport {
47204724
c.addServerAndClusterInfo(ci)

server/events.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ type ClientInfo struct {
328328
ClientType string `json:"client_type,omitempty"`
329329
MQTTClient string `json:"client_id,omitempty"` // This is the MQTT client ID
330330
Nonce string `json:"nonce,omitempty"`
331+
Reply string `json:"reply,omitempty"` // Original reply subject after a service import (only when needed).
331332
}
332333

333334
// forAssignmentSnap returns the minimum amount of ClientInfo we need for assignment snapshots.

0 commit comments

Comments
 (0)