@kronos-ts/axon-server 0.2.10 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/axon-server-event-store.d.ts +1 -1
  2. package/dist/axon-server-event-store.d.ts.map +1 -1
  3. package/dist/axon-server-event-store.js +3 -3
  4. package/dist/axon-server-event-store.js.map +1 -1
  5. package/dist/axon-server-snapshot-store.d.ts +1 -1
  6. package/dist/axon-server-snapshot-store.d.ts.map +1 -1
  7. package/dist/axon-server-snapshot-store.js +1 -1
  8. package/dist/axon-server-snapshot-store.js.map +1 -1
  9. package/dist/axon-server.d.ts +169 -43
  10. package/dist/axon-server.d.ts.map +1 -1
  11. package/dist/axon-server.js +191 -323
  12. package/dist/axon-server.js.map +1 -1
  13. package/dist/connection-manager.d.ts +2 -2
  14. package/dist/connection-manager.d.ts.map +1 -1
  15. package/dist/connection-manager.js +1 -1
  16. package/dist/connection-manager.js.map +1 -1
  17. package/dist/control-plane.d.ts +108 -0
  18. package/dist/control-plane.d.ts.map +1 -0
  19. package/dist/control-plane.js +96 -0
  20. package/dist/control-plane.js.map +1 -0
  21. package/dist/flow-controlled-sender.d.ts +1 -1
  22. package/dist/flow-controlled-sender.d.ts.map +1 -1
  23. package/dist/flow-controlled-sender.js +1 -1
  24. package/dist/flow-controlled-sender.js.map +1 -1
  25. package/dist/index.d.ts +10 -8
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +9 -8
  28. package/dist/index.js.map +1 -1
  29. package/dist/message-size.d.ts +1 -1
  30. package/dist/message-size.d.ts.map +1 -1
  31. package/dist/message-size.js +1 -1
  32. package/dist/message-size.js.map +1 -1
  33. package/dist/outbound-stream.d.ts +1 -1
  34. package/dist/outbound-stream.d.ts.map +1 -1
  35. package/dist/outbound-stream.js +1 -1
  36. package/dist/outbound-stream.js.map +1 -1
  37. package/dist/platform-service.d.ts +34 -3
  38. package/dist/platform-service.d.ts.map +1 -1
  39. package/dist/platform-service.js +113 -42
  40. package/dist/platform-service.js.map +1 -1
  41. package/dist/shutdown-latch.d.ts +1 -1
  42. package/dist/shutdown-latch.d.ts.map +1 -1
  43. package/dist/shutdown-latch.js +1 -1
  44. package/dist/shutdown-latch.js.map +1 -1
  45. package/package.json +14 -8
  46. package/src/axon-server-event-store.ts +3 -3
  47. package/src/axon-server-snapshot-store.ts +1 -1
  48. package/src/axon-server.ts +283 -367
  49. package/src/connection-manager.ts +2 -2
  50. package/src/control-plane.ts +195 -0
  51. package/src/flow-controlled-sender.ts +1 -1
  52. package/src/index.ts +19 -8
  53. package/src/message-size.ts +1 -1
  54. package/src/outbound-stream.ts +1 -1
  55. package/src/platform-service.ts +152 -48
  56. package/src/shutdown-latch.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"platform-service.d.ts","sourceRoot":"","sources":["../src/platform-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAI3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAGxE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,aAAa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MAAM,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAA;AAEjC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAE3F;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;;;;OAeG;IACH,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB;;;;;;;;OAQG;IACH,IAAI,IAAI,IAAI,CAAA;IACZ,4DAA4D;IAC5D,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAChD;;;OAGG;IACH,+BAA+B,CAAC,QAAQ,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACxE,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,2FAA2F;IAC3F,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAA;IACrC;;;OAGG;IACH,oCAAoC,CAAC,EAAE,MAAM,CAAA;CAC9C;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,oBAAoB,EAChC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,kBAAkB,CA0UpB"}
@@ -1,4 +1,4 @@
1
- import { createOutboundStream } from "./outbound-stream.js";
1
+ import { outboundStream } from "./outbound-stream.js";
2
2
  import { Metadata } from "nice-grpc";
3
3
  import { toEventProcessorInfo } from "./event-processor-info.js";
4
4
  /**
@@ -9,17 +9,32 @@ import { toEventProcessorInfo } from "./event-processor-info.js";
9
9
  * 2. Sends periodic heartbeats to verify connectivity
10
10
  * 3. Receives instructions from Axon Server (split, merge, pause, resume)
11
11
  */
12
- export function createPlatformConnection(connection, options) {
12
+ export function platformConnection(connection, options) {
13
13
  const heartbeatIntervalMs = options?.heartbeatIntervalMs ?? 10000;
14
14
  const heartbeatTimeoutMs = options?.heartbeatTimeoutMs ?? 7500;
15
15
  const processorsNotificationRateMs = options?.processorsNotificationRateMs ?? 500;
16
16
  const processorsNotificationInitialDelayMs = options?.processorsNotificationInitialDelayMs ?? 5000;
17
17
  const instructionHandlers = [];
18
18
  const processorStatusSuppliers = [];
19
+ /**
20
+ * Instructions that arrived before anything registered a handler.
21
+ *
22
+ * The control plane registers its handler before calling `start()`, but the
23
+ * DATA path now opens the same stream via `armConnectionMonitoring()` — which
24
+ * runs before any control plane exists. That leaves a window in which Axon
25
+ * Server can push an instruction at a client with nothing to route it to.
26
+ * Buffering makes the window harmless instead of merely forbidden: the first
27
+ * `onInstruction` registration drains this queue in arrival order. Mirrors the
28
+ * kronosdb platform connection, which has had this since its backend started
29
+ * the stream for `subscriptionsAcked()`.
30
+ */
31
+ const pendingInstructions = [];
19
32
  let isConnected = false;
20
33
  let heartbeatTimer = null;
21
34
  let heartbeatTimeoutTimer = null;
22
35
  let processorStatusTimer = null;
36
+ /** Guards against arming the status-report timer twice — see `startProcessorStatusReporting`. */
37
+ let processorStatusArmed = false;
23
38
  let lastHeartbeatResponse = Date.now();
24
39
  let outbound = null;
25
40
  /**
@@ -45,6 +60,11 @@ export function createPlatformConnection(connection, options) {
45
60
  // Parse instruction type
46
61
  const instruction = parseInstruction(message);
47
62
  if (instruction) {
63
+ if (instructionHandlers.length === 0) {
64
+ // Nothing to route to yet — hold it for the first registration
65
+ // rather than dropping it.
66
+ pendingInstructions.push(instruction);
67
+ }
48
68
  for (const handler of instructionHandlers) {
49
69
  try {
50
70
  await handler(instruction);
@@ -137,6 +157,15 @@ export function createPlatformConnection(connection, options) {
137
157
  }, heartbeatIntervalMs);
138
158
  }
139
159
  function startProcessorStatusReporting() {
160
+ // Idempotency guard. The control plane may call `start()` after the data
161
+ // path already brought the stream up, and `start()` is itself documented as
162
+ // safe to call twice. Without this flag a second call inside the initial
163
+ // delay window would leave TWO pending timeouts, each of which installs an
164
+ // interval, and only the last would be tracked in `processorStatusTimer` —
165
+ // the first would leak past `stop()`.
166
+ if (processorStatusArmed)
167
+ return;
168
+ processorStatusArmed = true;
140
169
  if (processorStatusTimer)
141
170
  clearInterval(processorStatusTimer);
142
171
  // Initial delay before first report
@@ -170,52 +199,79 @@ export function createPlatformConnection(connection, options) {
170
199
  }
171
200
  }
172
201
  }
202
+ /**
203
+ * Open the platform stream and arm the heartbeat. Shared by
204
+ * `armConnectionMonitoring()` (data path) and `start()` (control plane);
205
+ * whichever runs first opens it, the other finds it up and returns.
206
+ */
207
+ function openPlatformStream() {
208
+ if (isConnected)
209
+ return;
210
+ // A heartbeat timeout clears `isConnected` WITHOUT going through `stop()`,
211
+ // so a later call can land here with the dropped stream's outbound still
212
+ // open. Close it before replacing the reference, or it leaks. This is more
213
+ // reachable now that the data path arms the heartbeat: previously only a
214
+ // control plane could get here after a timeout.
215
+ if (outbound) {
216
+ outbound.close();
217
+ outbound = null;
218
+ }
219
+ // Re-arm the ack latch so a stop/start cycle correctly re-waits.
220
+ acked = false;
221
+ outbound = outboundStream();
222
+ // Register with Axon Server
223
+ outbound.send({
224
+ register: {
225
+ clientId: connection.config.clientId,
226
+ componentName: connection.config.componentName,
227
+ version: "1.0.0",
228
+ tags: {},
229
+ },
230
+ instructionId: "",
231
+ });
232
+ // Open bidirectional stream
233
+ const inbound = connection.platform.openStream(outbound.iterable, {
234
+ metadata: grpcMetadata,
235
+ });
236
+ isConnected = true;
237
+ // DATA PATH: the heartbeat is what calls connection.reconnect() on
238
+ // timeout, which is what the command/query buses hang their stream
239
+ // re-establishment off. It belongs to every service, administered or not.
240
+ startHeartbeat();
241
+ processInboundInstructions(inbound);
242
+ // Axon Server's PlatformService does NOT proactively emit an inbound
243
+ // frame in response to `register` — the stream is held open silently
244
+ // until either (a) the server pushes a topology / instruction event,
245
+ // or (b) one of our heartbeat pings round-trips back. That means the
246
+ // first-inbound-frame ack signal used by kronosdb (Plan 09-03 / D-102)
247
+ // doesn't fire deterministically here, and the processors-stage
248
+ // `withRetry({event: "per-operation"})` poll would otherwise hang.
249
+ //
250
+ // Axon-specific ack derivation: latch `acked = true` immediately once
251
+ // the outbound `register` frame has been flushed to the gRPC layer.
252
+ // Bus subscriptions (sent on the command/query streams, NOT the
253
+ // platform stream) are an orthogonal concern handled by the
254
+ // command/query bus reconnect path — the legacy 1-second sleep that
255
+ // we replaced was always covering register processing, not bus-side
256
+ // routability. Structurally this is the Axon Server equivalent of
257
+ // D-102: drop the magic-number wait, use the earliest deterministic
258
+ // observable signal that fits the underlying protocol.
259
+ acked = true;
260
+ }
173
261
  return {
262
+ async armConnectionMonitoring() {
263
+ openPlatformStream();
264
+ },
174
265
  async start() {
175
- if (isConnected)
176
- return;
177
- // Re-arm the ack latch so a stop/start cycle correctly re-waits.
178
- acked = false;
179
- outbound = createOutboundStream();
180
- // Register with Axon Server
181
- outbound.send({
182
- register: {
183
- clientId: connection.config.clientId,
184
- componentName: connection.config.componentName,
185
- version: "1.0.0",
186
- tags: {},
187
- },
188
- instructionId: "",
189
- });
190
- // Open bidirectional stream
191
- const inbound = connection.platform.openStream(outbound.iterable, {
192
- metadata: grpcMetadata,
193
- });
194
- isConnected = true;
195
- startHeartbeat();
266
+ openPlatformStream();
196
267
  startProcessorStatusReporting();
197
- processInboundInstructions(inbound);
198
- // Axon Server's PlatformService does NOT proactively emit an inbound
199
- // frame in response to `register` — the stream is held open silently
200
- // until either (a) the server pushes a topology / instruction event,
201
- // or (b) one of our heartbeat pings round-trips back. That means the
202
- // first-inbound-frame ack signal used by kronosdb (Plan 09-03 / D-102)
203
- // doesn't fire deterministically here, and the processors-stage
204
- // `withRetry({event: "per-operation"})` poll would otherwise hang.
205
- //
206
- // Axon-specific ack derivation: latch `acked = true` immediately once
207
- // the outbound `register` frame has been flushed to the gRPC layer.
208
- // Bus subscriptions (sent on the command/query streams, NOT the
209
- // platform stream) are an orthogonal concern handled by the
210
- // command/query bus reconnect path — the legacy 1-second sleep that
211
- // we replaced was always covering register processing, not bus-side
212
- // routability. Structurally this is the Axon Server equivalent of
213
- // D-102: drop the magic-number wait, use the earliest deterministic
214
- // observable signal that fits the underlying protocol.
215
- acked = true;
216
268
  },
217
269
  stop() {
218
270
  isConnected = false;
271
+ // A stopped stream's un-routed backlog is stale — do not replay it if a
272
+ // handler registers later.
273
+ pendingInstructions.length = 0;
274
+ processorStatusArmed = false;
219
275
  if (heartbeatTimer) {
220
276
  clearInterval(heartbeatTimer);
221
277
  heartbeatTimer = null;
@@ -234,7 +290,22 @@ export function createPlatformConnection(connection, options) {
234
290
  }
235
291
  },
236
292
  onInstruction(handler) {
293
+ const isFirst = instructionHandlers.length === 0;
237
294
  instructionHandlers.push(handler);
295
+ // Drain anything that arrived before a handler existed, in arrival order.
296
+ if (isFirst && pendingInstructions.length > 0) {
297
+ const backlog = pendingInstructions.splice(0, pendingInstructions.length);
298
+ void (async () => {
299
+ for (const instruction of backlog) {
300
+ try {
301
+ await handler(instruction);
302
+ }
303
+ catch (err) {
304
+ console.error("Platform instruction handler error:", err);
305
+ }
306
+ }
307
+ })();
308
+ }
238
309
  },
239
310
  registerProcessorStatusSupplier(supplier) {
240
311
  processorStatusSuppliers.push(supplier);
@@ -1 +1 @@
1
- {"version":3,"file":"platform-service.js","sourceRoot":"","sources":["../src/platform-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAuFhE;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mBAAmB,CAAC,MAAM,KAAK,CAAC,CAAA;YAChD,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAEjC,0EAA0E;YAC1E,IAAI,OAAO,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAA;gBACzE,KAAK,CAAC,KAAK,IAAI,EAAE;oBACf,KAAK,MAAM,WAAW,IAAI,OAAO,EAAE,CAAC;wBAClC,IAAI,CAAC;4BACH,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;wBAC5B,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACb,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAA;wBAC3D,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,EAAE,CAAA;YACN,CAAC;QACH,CAAC;QAED,+BAA+B,CAAC,QAAQ;YACtC,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACzC,CAAC;QAED,IAAI,SAAS;YACX,OAAO,WAAW,CAAA;QACpB,CAAC;QAED,KAAK,CAAC,kBAAkB;YACtB,OAAO,WAAW,IAAI,KAAK,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -34,5 +34,5 @@ export interface ActivityHandle {
34
34
  export declare class ShutdownInProgressError extends Error {
35
35
  constructor(message?: string);
36
36
  }
37
- export declare function createShutdownLatch(): ShutdownLatch;
37
+ export declare function shutdownLatch(): ShutdownLatch;
38
38
  //# sourceMappingURL=shutdown-latch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shutdown-latch.d.ts","sourceRoot":"","sources":["../src/shutdown-latch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,gBAAgB,IAAI,cAAc,CAAA;IAElC;;;;OAIG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjC,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAE9B,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,GAAG,IAAI,IAAI,CAAA;CACZ;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,GAAE,MAA+B;CAIrD;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CAmDnD"}
1
+ {"version":3,"file":"shutdown-latch.d.ts","sourceRoot":"","sources":["../src/shutdown-latch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,gBAAgB,IAAI,cAAc,CAAA;IAElC;;;;OAIG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjC,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAE9B,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,GAAG,IAAI,IAAI,CAAA;CACZ;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,GAAE,MAA+B;CAIrD;AAED,wBAAgB,aAAa,IAAI,aAAa,CAmD7C"}
@@ -4,7 +4,7 @@ export class ShutdownInProgressError extends Error {
4
4
  this.name = "ShutdownInProgressError";
5
5
  }
6
6
  }
7
- export function createShutdownLatch() {
7
+ export function shutdownLatch() {
8
8
  let activeCount = 0;
9
9
  let shuttingDown = false;
10
10
  let drainResolve = null;
@@ -1 +1 @@
1
- {"version":3,"file":"shutdown-latch.js","sourceRoot":"","sources":["../src/shutdown-latch.ts"],"names":[],"mappings":"AAsCA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD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on-server",
3
- "version": "0.2.10",
3
+ "version": "0.3.0",
4
4
  "description": "Axon Server extension for Kronos — event store and command bus over Axon Server.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -23,8 +23,8 @@
23
23
  "axon-server"
24
24
  ],
25
25
  "sideEffects": false,
26
- "main": "src/index.ts",
27
- "types": "src/index.ts",
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
28
  "files": [
29
29
  "dist",
30
30
  "src",
@@ -49,11 +49,11 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@kronos-ts/common": "0.1.1",
53
- "@kronos-ts/app": "0.5.2",
54
- "@kronos-ts/eventsourcing": "0.3.2",
55
- "@kronos-ts/messaging": "0.9.1",
56
- "@kronos-ts/modelling": "0.2.9",
52
+ "@kronos-ts/common": "0.1.2",
53
+ "@kronos-ts/app": "0.6.0",
54
+ "@kronos-ts/eventsourcing": "0.4.0",
55
+ "@kronos-ts/messaging": "0.10.0",
56
+ "@kronos-ts/modelling": "0.3.0",
57
57
  "@bufbuild/protobuf": "^2.3",
58
58
  "@grpc/grpc-js": "^1.12",
59
59
  "nice-grpc": "^2.1",
@@ -65,5 +65,11 @@
65
65
  "grpc_tools_node_protoc_ts": "^5.3",
66
66
  "testcontainers": "^11.13.0",
67
67
  "ts-proto": "^2.6"
68
+ },
69
+ "exports": {
70
+ ".": {
71
+ "types": "./dist/index.d.ts",
72
+ "default": "./dist/index.js"
73
+ }
68
74
  }
69
75
  }
@@ -11,7 +11,7 @@ import type {
11
11
  SequencedEvent,
12
12
  StreamingCondition,
13
13
  } from "@kronos-ts/messaging"
14
- import { createMessageStream } from "@kronos-ts/messaging"
14
+ import { messageStream } from "@kronos-ts/messaging"
15
15
  import type {
16
16
  EventStore,
17
17
  SourcingResult,
@@ -149,7 +149,7 @@ function createEventConverters(serializer: Serializer) {
149
149
  * a single gRPC Stream RPC call that stays open indefinitely, aligned with
150
150
  * Java's infinite {@code ResultStream}.
151
151
  */
152
- export function createAxonServerEventStore(connection: AxonServerConnection, serializer: Serializer): EventStore {
152
+ export function axonServerEventStore(connection: AxonServerConnection, serializer: Serializer): EventStore {
153
153
  const { eventToProto, eventFromProto } = createEventConverters(serializer)
154
154
 
155
155
  function createAxonMetadata(): Metadata {
@@ -296,7 +296,7 @@ export function createAxonServerEventStore(connection: AxonServerConnection, ser
296
296
 
297
297
  startReading()
298
298
 
299
- return createMessageStream<SequencedEvent>({
299
+ return messageStream<SequencedEvent>({
300
300
  next() {
301
301
  return buffer.shift()
302
302
  },
@@ -56,7 +56,7 @@ function encodeKey(stateName: string, id: unknown): Uint8Array {
56
56
  * state snapshots. Payload serialization uses the configured
57
57
  * Serializer (defaults to JSON).
58
58
  */
59
- export function createAxonServerSnapshotStore(
59
+ export function axonServerSnapshotStore(
60
60
  connection: AxonServerConnection,
61
61
  serializer: Serializer,
62
62
  ): SnapshotStore {