jspurefix 5.9.1 → 5.10.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 (145) hide show
  1. package/BACKPORT_PLAN.md +20 -7
  2. package/README.md +35 -0
  3. package/WORKLOG.md +119 -0
  4. package/dist/benchmark/bench-report.d.ts +5 -0
  5. package/dist/benchmark/bench-report.js +91 -0
  6. package/dist/benchmark/bench-report.js.map +1 -0
  7. package/dist/benchmark/bench-runner.d.ts +12 -0
  8. package/dist/benchmark/bench-runner.js +193 -0
  9. package/dist/benchmark/bench-runner.js.map +1 -0
  10. package/dist/benchmark/bench-stats.d.ts +10 -0
  11. package/dist/benchmark/bench-stats.js +56 -0
  12. package/dist/benchmark/bench-stats.js.map +1 -0
  13. package/dist/benchmark/bench-types.d.ts +74 -0
  14. package/dist/benchmark/bench-types.js +3 -0
  15. package/dist/benchmark/bench-types.js.map +1 -0
  16. package/dist/benchmark/gc-probe.d.ts +18 -0
  17. package/dist/benchmark/gc-probe.js +103 -0
  18. package/dist/benchmark/gc-probe.js.map +1 -0
  19. package/dist/benchmark/index.d.ts +6 -0
  20. package/dist/benchmark/index.js +23 -0
  21. package/dist/benchmark/index.js.map +1 -0
  22. package/dist/benchmark/parse-bench.d.ts +28 -0
  23. package/dist/benchmark/parse-bench.js +85 -0
  24. package/dist/benchmark/parse-bench.js.map +1 -0
  25. package/dist/buffer/ascii/ascii-encoder.d.ts +1 -0
  26. package/dist/buffer/ascii/ascii-encoder.js +15 -0
  27. package/dist/buffer/ascii/ascii-encoder.js.map +1 -1
  28. package/dist/buffer/ascii/ascii-parser.d.ts +1 -0
  29. package/dist/buffer/ascii/ascii-parser.js +4 -1
  30. package/dist/buffer/ascii/ascii-parser.js.map +1 -1
  31. package/dist/buffer/ascii/ascii-segment-parser.js +3 -2
  32. package/dist/buffer/ascii/ascii-segment-parser.js.map +1 -1
  33. package/dist/buffer/ascii/tag-index.js.map +1 -1
  34. package/dist/buffer/msg-encoder.d.ts +2 -0
  35. package/dist/buffer/msg-encoder.js +1 -0
  36. package/dist/buffer/msg-encoder.js.map +1 -1
  37. package/dist/buffer/msg-view.d.ts +1 -0
  38. package/dist/buffer/msg-view.js +25 -19
  39. package/dist/buffer/msg-view.js.map +1 -1
  40. package/dist/dictionary/parser/quickfix/dictionary-validator.d.ts +1 -1
  41. package/dist/dictionary/parser/quickfix/dictionary-validator.js.map +1 -1
  42. package/dist/dictionary/parser/quickfix/quick-fix-graph-parser.d.ts +1 -1
  43. package/dist/dictionary/parser/quickfix/quick-fix-graph-parser.js +1 -2
  44. package/dist/dictionary/parser/quickfix/quick-fix-graph-parser.js.map +1 -1
  45. package/dist/dictionary/parser/quickfix/validation-error.d.ts +2 -2
  46. package/dist/dictionary/parser/quickfix/validation-error.js.map +1 -1
  47. package/dist/jsfix-bench.d.ts +1 -0
  48. package/dist/jsfix-bench.js +213 -0
  49. package/dist/jsfix-bench.js.map +1 -0
  50. package/dist/runtime/session-container.d.ts +3 -0
  51. package/dist/runtime/session-container.js +8 -0
  52. package/dist/runtime/session-container.js.map +1 -1
  53. package/dist/runtime/session-launcher.d.ts +2 -1
  54. package/dist/runtime/session-launcher.js +4 -1
  55. package/dist/runtime/session-launcher.js.map +1 -1
  56. package/dist/store/file-session-store.js +1 -1
  57. package/dist/store/file-session-store.js.map +1 -1
  58. package/dist/store/file-session-stream-provider.d.ts +1 -0
  59. package/dist/store/file-session-stream-provider.js +13 -13
  60. package/dist/store/file-session-stream-provider.js.map +1 -1
  61. package/dist/store/fix-session-store-factory.d.ts +1 -1
  62. package/dist/store/fix-session-store-factory.js.map +1 -1
  63. package/dist/store/fix-session-store.d.ts +11 -11
  64. package/dist/store/fix-session-store.js.map +1 -1
  65. package/dist/store/memory-session-store.js.map +1 -1
  66. package/dist/store/session-stream-provider.d.ts +13 -13
  67. package/dist/store/session-stream-provider.js.map +1 -1
  68. package/dist/transport/ascii/ascii-msg-transmitter.d.ts +1 -0
  69. package/dist/transport/ascii/ascii-msg-transmitter.js +15 -0
  70. package/dist/transport/ascii/ascii-msg-transmitter.js.map +1 -1
  71. package/dist/transport/ascii/ascii-session-msg-factory.js +1 -7
  72. package/dist/transport/ascii/ascii-session-msg-factory.js.map +1 -1
  73. package/dist/transport/fixml/fixml-session-msg-factory.js +1 -6
  74. package/dist/transport/fixml/fixml-session-msg-factory.js.map +1 -1
  75. package/dist/transport/index.d.ts +3 -0
  76. package/dist/transport/index.js +3 -0
  77. package/dist/transport/index.js.map +1 -1
  78. package/dist/transport/msg-payload.d.ts +3 -1
  79. package/dist/transport/msg-payload.js +2 -1
  80. package/dist/transport/msg-payload.js.map +1 -1
  81. package/dist/transport/msg-transmitter.d.ts +4 -1
  82. package/dist/transport/msg-transmitter.js +18 -2
  83. package/dist/transport/msg-transmitter.js.map +1 -1
  84. package/dist/transport/send-callback.d.ts +7 -0
  85. package/dist/transport/send-callback.js +3 -0
  86. package/dist/transport/send-callback.js.map +1 -0
  87. package/dist/transport/session/fix-clock.d.ts +1 -1
  88. package/dist/transport/session/fix-clock.js.map +1 -1
  89. package/dist/transport/session/fix-session.d.ts +2 -1
  90. package/dist/transport/session/fix-session.js +12 -3
  91. package/dist/transport/session/fix-session.js.map +1 -1
  92. package/dist/transport/session/resend-request-manager.d.ts +2 -2
  93. package/dist/transport/session/resend-request-manager.js.map +1 -1
  94. package/dist/transport/session/session-description.d.ts +2 -0
  95. package/dist/transport/session/session-description.js.map +1 -1
  96. package/dist/transport/session/session-sequence-coordinator.d.ts +1 -1
  97. package/dist/transport/session/session-sequence-coordinator.js.map +1 -1
  98. package/dist/transport/session/session-sequence-store.d.ts +3 -3
  99. package/dist/transport/session/session-sequence-store.js.map +1 -1
  100. package/dist/transport/tcp/tcp-initiator.js.map +1 -1
  101. package/docs/benchmarking.md +117 -0
  102. package/docs/custom-logon.md +225 -0
  103. package/eslint.config.mjs +15 -1
  104. package/jsfix.test_client.txt +62 -62
  105. package/jsfix.test_server.txt +72 -72
  106. package/package.json +9 -1
  107. package/src/benchmark/bench-report.ts +101 -0
  108. package/src/benchmark/bench-runner.ts +196 -0
  109. package/src/benchmark/bench-stats.ts +86 -0
  110. package/src/benchmark/bench-types.ts +110 -0
  111. package/src/benchmark/gc-probe.ts +145 -0
  112. package/src/benchmark/index.ts +6 -0
  113. package/src/benchmark/parse-bench.ts +144 -0
  114. package/src/buffer/ascii/ascii-encoder.ts +20 -0
  115. package/src/buffer/ascii/ascii-parser.ts +16 -1
  116. package/src/buffer/ascii/ascii-segment-parser.ts +9 -6
  117. package/src/buffer/ascii/tag-index.ts +3 -3
  118. package/src/buffer/msg-encoder.ts +12 -0
  119. package/src/buffer/msg-view.ts +35 -18
  120. package/src/dictionary/parser/quickfix/dictionary-validator.ts +1 -1
  121. package/src/dictionary/parser/quickfix/quick-fix-graph-parser.ts +2 -3
  122. package/src/dictionary/parser/quickfix/validation-error.ts +1 -1
  123. package/src/jsfix-bench.ts +204 -0
  124. package/src/runtime/session-container.ts +20 -0
  125. package/src/runtime/session-launcher.ts +19 -2
  126. package/src/store/file-session-store.ts +2 -2
  127. package/src/store/file-session-stream-provider.ts +17 -11
  128. package/src/store/fix-session-store-factory.ts +1 -1
  129. package/src/store/fix-session-store.ts +11 -11
  130. package/src/store/memory-session-store.ts +1 -1
  131. package/src/store/session-stream-provider.ts +13 -13
  132. package/src/transport/ascii/ascii-msg-transmitter.ts +20 -0
  133. package/src/transport/ascii/ascii-session-msg-factory.ts +6 -1
  134. package/src/transport/fixml/fixml-session-msg-factory.ts +3 -1
  135. package/src/transport/index.ts +5 -0
  136. package/src/transport/msg-payload.ts +5 -1
  137. package/src/transport/msg-transmitter.ts +31 -2
  138. package/src/transport/send-callback.ts +33 -0
  139. package/src/transport/session/fix-clock.ts +1 -1
  140. package/src/transport/session/fix-session.ts +22 -3
  141. package/src/transport/session/resend-request-manager.ts +4 -4
  142. package/src/transport/session/session-description.ts +14 -0
  143. package/src/transport/session/session-sequence-coordinator.ts +1 -1
  144. package/src/transport/session/session-sequence-store.ts +3 -3
  145. package/src/transport/tcp/tcp-initiator.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tcp-initiator.js","sourceRoot":"","sources":["../../../src/transport/tcp/tcp-initiator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA+C;AAC/C,wCAAyC;AAGzC,sCAAgD;AAEhD,2CAA4B;AAC5B,6BAAyE;AACzE,6BAAsC;AAEtC,+DAAyD;AACzD,uDAA0G;AAC1G,uCAA6C;AAC7C,uDAAkD;AAGlD,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,mDAAQ,CAAA;IACR,+DAAc,CAAA;IACd,6DAAa,CAAA;IACb,yDAAW,CAAA;AACb,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAO5C,YAA4C,WAAyC;;QACnF,KAAK,CAAC,MAAA,WAAW,CAAC,WAAW,CAAC,WAAW,mCAAI,IAAI,CAAC,CAAA;QADQ,gBAAW,GAAX,WAAW,CAAc;QAL9E,UAAK,GAAmB,cAAc,CAAC,IAAI,CAAA;QAG1C,OAAE,GAAmB,IAAI,CAAA;QAI/B,MAAM,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,mCAAI,WAAW,CAAA;QAClD,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC,CAAA;QACnE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;QAC3D,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,MAAA,IAAI,CAAC,WAAW,CAAC,GAAG,mCAAI,IAAI,CAAA;QACvC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,IAA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,KAAK,GAAG,cAAc,CAAC,OAAO,CAAA;oBACnC,MAAM,CAAC,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,KAAK,CAAC,GAAG,IAAI,gBAAgB,cAAc,oBAAoB,CAAC,CAAA;oBAC3F,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,qBAAqB,cAAc,SAAS,OAAO,yBAAyB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;oBACnH,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;oBACX,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA,CAAC,CAAA;QACJ,CAAC;KAAA;CACF,CAAA;AAzMY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,qBAAU,GAAE;IAQG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GAPhC,YAAY,CAyMxB","sourcesContent":["import { FixInitiator } from '../fix-initiator'\nimport { MsgTransport } from '../factory'\n\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\nimport { TcpDuplex, FixDuplex } from '../duplex'\n\nimport * as util from 'util'\nimport { connect as tlsConnect, ConnectionOptions, TLSSocket } from 'tls'\nimport { createConnection } from 'net'\nimport Timeout = NodeJS.Timeout\nimport { TlsOptionsFactory } from './tls-options-factory'\nimport { describeConnectionOptions, describeNegotiated, describePeerCertificate } from './tls-diagnostics'\nimport { inject, injectable } from 'tsyringe'\nimport { DITokens } from '../../runtime/di-tokens'\nimport { ITcpTransportDescription } from './tcp-transport-description'\n\nexport enum InitiatorState {\n Idle = 1,\n Connecting = 2,\n Connected = 3,\n Stopped = 4\n}\n\n@injectable()\nexport class TcpInitiator extends FixInitiator {\n public tcp: ITcpTransportDescription | null\n public state: InitiatorState = InitiatorState.Idle\n private readonly logger: IJsFixLogger\n private duplex: FixDuplex\n private th: Timeout | null = null\n\n constructor (@inject(DITokens.IJsFixConfig) public readonly jsFixConfig: IJsFixConfig) {\n super(jsFixConfig.description.application ?? null)\n const name = this.application?.name ?? 'initiator'\n this.logger = jsFixConfig.logFactory.logger(`${name}:TcpInitiator`)\n if (!this.application) {\n throw new Error('no application in session description.')\n }\n this.tcp = this.application.tcp ?? null\n if (!this.tcp) {\n throw new Error('no tcp in session description need tcp { host: hostname, port: port }')\n }\n }\n\n public end (): void {\n this.clearTimer()\n switch (this.state) {\n case InitiatorState.Connected: {\n this.logger.info('end')\n this.duplex.end()\n this.state = InitiatorState.Stopped\n break\n }\n\n default: {\n this.logger.info(`end :state ${this.state}`)\n this.state = InitiatorState.Stopped\n break\n }\n }\n }\n\n public async connect (timeoutSeconds: number): Promise<MsgTransport> {\n return await new Promise<MsgTransport>(async (resolve, reject) => {\n switch (this.state) {\n case InitiatorState.Idle: {\n this.state = InitiatorState.Connecting\n this.logger.info(`connecting with timeout ${timeoutSeconds}`)\n this.tryConnect()\n .then((t: MsgTransport) => { resolve(t) })\n .catch((first: Error) => {\n // carry the first failure into repeatConnect. it used to be discarded, so a\n // connect() whose timeout expires before the first retry interval fires - the\n // default case, timeout and reconnectSeconds are both 5 - reported a generic\n // \"timeout whilst connecting\" and threw away the reason. see #94.\n this.logger.info(`first connect attempt failed: ${first.message}`)\n this.repeatConnect(timeoutSeconds, first)\n .then((t: MsgTransport) => { resolve(t) })\n .catch((e: Error) => { reject(e) })\n })\n break\n }\n\n default: {\n const e: Error = new Error('connect not valid from non idle state')\n this.logger.warning(`rejecting from state ${this.state}`)\n reject(e)\n }\n }\n })\n }\n\n private async unsecureDuplex (): Promise<TcpDuplex> {\n const tcp = this.tcp\n return await new Promise<TcpDuplex>((resolve, reject) => {\n try {\n this.logger.info('unsecureDuplex try to connect to endPoint')\n const socket = tcp\n ? createConnection(tcp, () => {\n try {\n this.logger.info('net.createConnection cb, resolving')\n if (socket) {\n const tcpDuplex = new TcpDuplex(socket)\n resolve(tcpDuplex)\n } else {\n reject(new Error('no socket in tcp initiator'))\n }\n } catch (e) {\n reject(e)\n }\n })\n : null\n socket?.on('error', (err) => {\n reject(err)\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n private async tlsDuplex (): Promise<TcpDuplex > {\n return await new Promise<TcpDuplex>((resolve, reject) => {\n let tlsSocket: TLSSocket | null = null\n const tcp = this.tcp\n const connectionOptions: ConnectionOptions | null = tcp ? TlsOptionsFactory.getTlsConnectionOptions(tcp) : null\n if (connectionOptions) {\n try {\n this.logger.info(`tls connect with ${describeConnectionOptions(connectionOptions)}`)\n tlsSocket = tlsConnect(connectionOptions, () => {\n if (!tlsSocket) return null\n this.logger.info(`client connected ${tlsSocket.authorized ? 'authorized' : 'unauthorized'}`)\n this.logger.info(`tls negotiated ${describeNegotiated(tlsSocket)}`)\n this.logger.info(`tls peer certificate ${describePeerCertificate(tlsSocket)}`)\n // https://github.com/TimelordUK/jspurefix/issues/94 - honour rejectUnauthorized:\n // false rather than always rejecting on an unauthorized cert. Node's tls.connect()\n // never throws for an unauthorized peer by itself; it's the caller's job to decide\n // what to do with tlsSocket.authorized, and rejectUnauthorized is how a caller opts\n // out of that check - so only reject here when the caller didn't opt out.\n if (!tlsSocket.authorized && connectionOptions.rejectUnauthorized !== false) {\n const error = tlsSocket.authorizationError\n this.logger.warning(`rejecting from state ${this.state} authorizationError ${error}`)\n tlsSocket.end()\n reject(error)\n } else {\n if (!tlsSocket.authorized) {\n this.logger.warning(`proceeding despite unauthorized TLS peer (rejectUnauthorized: false): ${tlsSocket.authorizationError}`)\n }\n tlsSocket.setEncoding('utf8')\n const tlsDuplex = new TcpDuplex(tlsSocket)\n if (tcp?.tls?.enableTrace) {\n this.logger.info('enabling tls session trace')\n tlsSocket.enableTrace()\n }\n this.logger.info('tlsDuplex resolving')\n resolve(tlsDuplex)\n }\n })\n tlsSocket.on('error', (err) => {\n // previously silent - the socket error is the real reason a tls session failed,\n // and without it the caller only ever sees repeatConnect's generic timeout.\n this.logger.warning(`tls socket error from state ${this.state}: ${err.message}`)\n reject(err)\n })\n } catch (e) {\n reject(e)\n }\n }\n })\n }\n\n private async tryConnect (): Promise < MsgTransport > {\n return await new Promise<MsgTransport>((resolve, reject) => {\n const tcp = this.tcp\n const connectionOptions: ConnectionOptions | null = tcp ? TlsOptionsFactory.getTlsConnectionOptions(tcp) : null\n const connector = connectionOptions ? this.tlsDuplex() : this.unsecureDuplex()\n this.logger.info(`tryConnect ${tcp?.host}:${tcp?.port}`)\n connector.then(duplex => {\n this.duplex = duplex\n resolve(new MsgTransport(0, this.jsFixConfig, duplex))\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n public clearTimer (): void {\n if (this.th) {\n clearInterval(this.th)\n this.th = null\n }\n }\n\n private async repeatConnect (timeoutSeconds: number, initialError?: Error): Promise < MsgTransport > {\n return await new Promise<MsgTransport>(async (resolve, reject) => {\n const application = this.application\n const promisify = util.promisify\n const timeoutPromise = promisify(setTimeout)\n const reconnectSeconds = application?.reconnectSeconds ?? 5\n let retries = 0\n let lastError: Error = initialError as Error\n const name = application?.name ?? 'initiator'\n this.th = setInterval(() => {\n ++retries\n this.tryConnect()\n .then((t: MsgTransport) => {\n this.state = InitiatorState.Connected\n this.clearTimer()\n resolve(t)\n }).catch((e: Error) => {\n lastError = e\n this.logger.info(`${name}: retries ${retries} ${e.message}`)\n })\n }, reconnectSeconds * 1000)\n timeoutPromise(timeoutSeconds * 1000).then(() => {\n this.clearTimer()\n this.state = InitiatorState.Stopped\n const e = lastError ?? new Error(`${name}: timeout of ${timeoutSeconds} whilst connecting`)\n this.logger.warning(`${name}: giving up after ${timeoutSeconds}s and ${retries} retries, last error: ${e.message}`)\n reject(e)\n }).catch(e => {\n reject(e)\n })\n })\n }\n}\n"]}
1
+ {"version":3,"file":"tcp-initiator.js","sourceRoot":"","sources":["../../../src/transport/tcp/tcp-initiator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,GAAG,IAAI,qBAAqB,cAAc,SAAS,OAAO,yBAAyB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;oBACnH,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;oBACX,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA,CAAC,CAAA;QACJ,CAAC;KAAA;CACF,CAAA;AAzMY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,qBAAU,GAAE;IAQG,WAAA,IAAA,iBAAM,EAAC,oBAAQ,CAAC,YAAY,CAAC,CAAA;;GAPhC,YAAY,CAyMxB","sourcesContent":["import { FixInitiator } from '../fix-initiator'\nimport { MsgTransport } from '../factory'\n\nimport { IJsFixConfig, IJsFixLogger } from '../../config'\nimport { TcpDuplex, FixDuplex } from '../duplex'\n\nimport * as util from 'util'\nimport { connect as tlsConnect, ConnectionOptions, TLSSocket } from 'tls'\nimport { createConnection } from 'net'\nimport Timeout = NodeJS.Timeout\nimport { TlsOptionsFactory } from './tls-options-factory'\nimport { describeConnectionOptions, describeNegotiated, describePeerCertificate } from './tls-diagnostics'\nimport { inject, injectable } from 'tsyringe'\nimport { DITokens } from '../../runtime/di-tokens'\nimport { ITcpTransportDescription } from './tcp-transport-description'\n\nexport enum InitiatorState {\n Idle = 1,\n Connecting = 2,\n Connected = 3,\n Stopped = 4\n}\n\n@injectable()\nexport class TcpInitiator extends FixInitiator {\n public tcp: ITcpTransportDescription | null\n public state: InitiatorState = InitiatorState.Idle\n private readonly logger: IJsFixLogger\n private duplex: FixDuplex\n private th: Timeout | null = null\n\n constructor (@inject(DITokens.IJsFixConfig) public readonly jsFixConfig: IJsFixConfig) {\n super(jsFixConfig.description.application ?? null)\n const name = this.application?.name ?? 'initiator'\n this.logger = jsFixConfig.logFactory.logger(`${name}:TcpInitiator`)\n if (!this.application) {\n throw new Error('no application in session description.')\n }\n this.tcp = this.application.tcp ?? null\n if (!this.tcp) {\n throw new Error('no tcp in session description need tcp { host: hostname, port: port }')\n }\n }\n\n public end (): void {\n this.clearTimer()\n switch (this.state) {\n case InitiatorState.Connected: {\n this.logger.info('end')\n this.duplex.end()\n this.state = InitiatorState.Stopped\n break\n }\n\n default: {\n this.logger.info(`end :state ${this.state}`)\n this.state = InitiatorState.Stopped\n break\n }\n }\n }\n\n public async connect (timeoutSeconds: number): Promise<MsgTransport> {\n return await new Promise<MsgTransport>(async (resolve, reject) => {\n switch (this.state) {\n case InitiatorState.Idle: {\n this.state = InitiatorState.Connecting\n this.logger.info(`connecting with timeout ${timeoutSeconds}`)\n this.tryConnect()\n .then((t: MsgTransport) => { resolve(t) })\n .catch((first: Error) => {\n // carry the first failure into repeatConnect. it used to be discarded, so a\n // connect() whose timeout expires before the first retry interval fires - the\n // default case, timeout and reconnectSeconds are both 5 - reported a generic\n // \"timeout whilst connecting\" and threw away the reason. see #94.\n this.logger.info(`first connect attempt failed: ${first.message}`)\n this.repeatConnect(timeoutSeconds, first)\n .then((t: MsgTransport) => { resolve(t) })\n .catch((e: Error) => { reject(e) })\n })\n break\n }\n\n default: {\n const e: Error = new Error('connect not valid from non idle state')\n this.logger.warning(`rejecting from state ${this.state}`)\n reject(e)\n }\n }\n })\n }\n\n private async unsecureDuplex (): Promise<TcpDuplex> {\n const tcp = this.tcp\n return await new Promise<TcpDuplex>((resolve, reject) => {\n try {\n this.logger.info('unsecureDuplex try to connect to endPoint')\n const socket = tcp\n ? createConnection(tcp, () => {\n try {\n this.logger.info('net.createConnection cb, resolving')\n if (socket) {\n const tcpDuplex = new TcpDuplex(socket)\n resolve(tcpDuplex)\n } else {\n reject(new Error('no socket in tcp initiator'))\n }\n } catch (e) {\n reject(e)\n }\n })\n : null\n socket?.on('error', (err) => {\n reject(err)\n })\n } catch (e) {\n reject(e)\n }\n })\n }\n\n private async tlsDuplex (): Promise<TcpDuplex > {\n return await new Promise<TcpDuplex>((resolve, reject) => {\n let tlsSocket: TLSSocket | null = null\n const tcp = this.tcp\n const connectionOptions: ConnectionOptions | null = tcp ? TlsOptionsFactory.getTlsConnectionOptions(tcp) : null\n if (connectionOptions) {\n try {\n this.logger.info(`tls connect with ${describeConnectionOptions(connectionOptions)}`)\n tlsSocket = tlsConnect(connectionOptions, () => {\n if (!tlsSocket) return null\n this.logger.info(`client connected ${tlsSocket.authorized ? 'authorized' : 'unauthorized'}`)\n this.logger.info(`tls negotiated ${describeNegotiated(tlsSocket)}`)\n this.logger.info(`tls peer certificate ${describePeerCertificate(tlsSocket)}`)\n // https://github.com/TimelordUK/jspurefix/issues/94 - honour rejectUnauthorized:\n // false rather than always rejecting on an unauthorized cert. Node's tls.connect()\n // never throws for an unauthorized peer by itself; it's the caller's job to decide\n // what to do with tlsSocket.authorized, and rejectUnauthorized is how a caller opts\n // out of that check - so only reject here when the caller didn't opt out.\n if (!tlsSocket.authorized && connectionOptions.rejectUnauthorized !== false) {\n const error = tlsSocket.authorizationError\n this.logger.warning(`rejecting from state ${this.state} authorizationError ${error}`)\n tlsSocket.end()\n reject(error)\n } else {\n if (!tlsSocket.authorized) {\n this.logger.warning(`proceeding despite unauthorized TLS peer (rejectUnauthorized: false): ${tlsSocket.authorizationError}`)\n }\n tlsSocket.setEncoding('utf8')\n const tlsDuplex = new TcpDuplex(tlsSocket)\n if (tcp?.tls?.enableTrace) {\n this.logger.info('enabling tls session trace')\n tlsSocket.enableTrace()\n }\n this.logger.info('tlsDuplex resolving')\n resolve(tlsDuplex)\n }\n })\n tlsSocket.on('error', (err) => {\n // previously silent - the socket error is the real reason a tls session failed,\n // and without it the caller only ever sees repeatConnect's generic timeout.\n this.logger.warning(`tls socket error from state ${this.state}: ${err.message}`)\n reject(err)\n })\n } catch (e) {\n reject(e)\n }\n }\n })\n }\n\n private async tryConnect (): Promise < MsgTransport > {\n return await new Promise<MsgTransport>((resolve, reject) => {\n const tcp = this.tcp\n const connectionOptions: ConnectionOptions | null = tcp ? TlsOptionsFactory.getTlsConnectionOptions(tcp) : null\n const connector = connectionOptions ? this.tlsDuplex() : this.unsecureDuplex()\n this.logger.info(`tryConnect ${tcp?.host}:${tcp?.port}`)\n connector.then(duplex => {\n this.duplex = duplex\n resolve(new MsgTransport(0, this.jsFixConfig, duplex))\n }).catch(e => {\n reject(e)\n })\n })\n }\n\n public clearTimer (): void {\n if (this.th) {\n clearInterval(this.th)\n this.th = null\n }\n }\n\n private async repeatConnect (timeoutSeconds: number, initialError?: Error): Promise < MsgTransport > {\n return await new Promise<MsgTransport>(async (resolve, reject) => {\n const application = this.application\n const promisify = util.promisify\n const timeoutPromise = promisify(setTimeout)\n const reconnectSeconds = application?.reconnectSeconds ?? 5\n let retries = 0\n let lastError: Error | undefined = initialError\n const name = application?.name ?? 'initiator'\n this.th = setInterval(() => {\n ++retries\n this.tryConnect()\n .then((t: MsgTransport) => {\n this.state = InitiatorState.Connected\n this.clearTimer()\n resolve(t)\n }).catch((e: Error) => {\n lastError = e\n this.logger.info(`${name}: retries ${retries} ${e.message}`)\n })\n }, reconnectSeconds * 1000)\n timeoutPromise(timeoutSeconds * 1000).then(() => {\n this.clearTimer()\n this.state = InitiatorState.Stopped\n const e = lastError ?? new Error(`${name}: timeout of ${timeoutSeconds} whilst connecting`)\n this.logger.warning(`${name}: giving up after ${timeoutSeconds}s and ${retries} retries, last error: ${e.message}`)\n reject(e)\n }).catch(e => {\n reject(e)\n })\n })\n }\n}\n"]}
@@ -0,0 +1,117 @@
1
+ # Benchmarking
2
+
3
+ `jsfix-bench` drives fix bytes through the real parser and reports what the work
4
+ costs in time and in garbage. It exists so a change to a hot path can be argued
5
+ about with a number rather than an opinion.
6
+
7
+ ```
8
+ npm run build
9
+ npm run bench
10
+ ```
11
+
12
+ Always under `--expose-gc`, which the npm scripts do for you. Without it rounds
13
+ cannot be isolated from one another and the retained heap figures mean very
14
+ little; the report says so at the top when it is missing.
15
+
16
+ ## What it measures
17
+
18
+ Two cases by default, over the same input:
19
+
20
+ | case | what it covers |
21
+ | --- | --- |
22
+ | `parse:view` | tokenise, discover the structure, build the `MsgView` |
23
+ | `parse:object` | the above, then `toObject()` to materialise the object graph |
24
+
25
+ Both matter. `parse:view` is the engine's own cost. `parse:object` is what a
26
+ drop copy consumer actually pays, and the gap between them is the price of
27
+ materialising a message rather than reading fields out of the view.
28
+
29
+ ## Reading the report
30
+
31
+ ```
32
+ parse:object
33
+ rounds 8 x 4000 msgs (warmup 4000)
34
+ per msg median 239.922us min 231.305us p95 242.623us max 242.623us
35
+ throughput 4,168 msg/sec
36
+ noise 1.80% of median (a change smaller than this means nothing)
37
+ gc pass 4000 msgs uninterrupted: 25 minor 0 major 5.8ms paused
38
+ gc rate 6250.0 minor/M msgs 0.0 major/M msgs 1445ms paused/M msgs
39
+ retained -0.00MB -0.6 bytes/msg heap at end of pass 116.08MB
40
+ ```
41
+
42
+ - **rounds** each contribute one timing sample. One long run cannot tell you
43
+ whether a number repeats.
44
+ - **min** is the closest reading to the true cost of the work - a round can only
45
+ be made slower by interference, never faster - while **median** is what to
46
+ expect in practice.
47
+ - **noise** is the run to run spread. Treat it as the resolution of the
48
+ instrument: a change smaller than this is not evidence of anything.
49
+ - **gc rate** is collections per million messages. Node will not tell you how
50
+ many bytes a stretch of code allocated, so scavenge frequency is the stand in.
51
+ In practice it is far more repeatable than the timings - the same build tends
52
+ to reproduce it exactly - which makes it the more sensitive of the two signals
53
+ for spotting an allocation change.
54
+ - **retained** is what the pass left behind after a forced collection, not what
55
+ it churned through. A steady state parser should sit near zero. Churn is what
56
+ the gc figures are for.
57
+
58
+ ## Why timing and memory are measured separately
59
+
60
+ Isolating a timed round means forcing a collection between rounds, and a forced
61
+ collection is itself a gc event - counting those would report the harness rather
62
+ than the engine. So the timed rounds collect between them and report no gc
63
+ figures, and a separate uninterrupted pass runs with the probe attached and
64
+ reports no timings. BenchmarkDotNet splits its memory diagnoser out of the
65
+ timed iterations for the same reason.
66
+
67
+ Node also dispatches a gc entry on the turn *after* the collection, and the
68
+ benchmark loop is synchronous, so the runner yields until delivery goes quiet
69
+ before reading the totals. A single yield loses most of them.
70
+
71
+ ## Comparing against a baseline
72
+
73
+ ```
74
+ npm run build
75
+ node --expose-gc dist/jsfix-bench --save=benchmarks/baseline.json --label="before"
76
+ # ... make a change, rebuild ...
77
+ node --expose-gc dist/jsfix-bench --baseline=benchmarks/baseline.json
78
+ ```
79
+
80
+ ```
81
+ parse:object
82
+ per msg 239.922us -> 243.523us +1.50% noise (noise floor +/-2.75%)
83
+ minor gc 6250.0 -> 6250.0 per M msgs +0.00%
84
+ ```
85
+
86
+ A difference is only called `FASTER` or `SLOWER` when it is larger than the
87
+ spread both runs displayed. Anything else is reported as `noise`, because that
88
+ is what it is. Baselines are specific to the machine and node build that took
89
+ them - the report warns when they differ - so `benchmarks/` is not committed.
90
+
91
+ ## Options
92
+
93
+ | flag | meaning |
94
+ | --- | --- |
95
+ | `--fix=<path>` | fix log to parse |
96
+ | `--dict=<name>` | dictionary, e.g. `qf44`, `repo44`, `qf50sp2` |
97
+ | `--delimiter=<char>` | field delimiter in the log, defaults to `\|` |
98
+ | `--depth=view,object` | which stages to measure |
99
+ | `--rounds=<n>` | measured rounds, one sample each |
100
+ | `--msgs=<n>` | messages per round |
101
+ | `--warmup=<n>` | messages discarded before measuring |
102
+ | `--save=<path>` | write the suite to json |
103
+ | `--baseline=<path>` | compare against a saved suite |
104
+ | `--json` | print the suite as json instead of a report |
105
+
106
+ Ready made suites: `bench:er`, `bench:er2`, `bench:nos`, `bench:md`, `bench:tc`.
107
+
108
+ Message counts are rounded up to a whole number of passes over the input file,
109
+ since a pass cannot be stopped part way. A log holding one message gives the
110
+ finest control.
111
+
112
+ ## Warmup
113
+
114
+ The default warmup is 20,000 messages. V8 needs to see a function run several
115
+ thousand times before it stops interpreting it, so an unwarmed first round
116
+ measures the wrong code. If you lower it, check the noise figure has not risen -
117
+ that is what an under-warmed run looks like.
@@ -0,0 +1,225 @@
1
+ # Customising the Logon
2
+
3
+ Almost every counterparty wants something on the Logon that the standard message does
4
+ not carry — an account, a default application version, a broker-issued token, a free
5
+ text field. This is the single most asked question about jspurefix
6
+ ([#93](https://github.com/TimelordUK/jspurefix/issues/93),
7
+ [#39](https://github.com/TimelordUK/jspurefix/issues/39),
8
+ [#96](https://github.com/TimelordUK/jspurefix/issues/96)) and it has a short answer
9
+ and a long one.
10
+
11
+ **The short answer:** two things must both be true, and people usually only do one.
12
+
13
+ 1. The field must be **on the Logon object** the engine sends.
14
+ 2. The field must be **declared on Logon in the dictionary** the session loads —
15
+ otherwise the encoder has no tag to write and drops it.
16
+
17
+ Doing (1) without (2) is the classic failure: you add the field, nothing changes, and
18
+ nothing explains why. The engine warns when it drops a field, so watch the log:
19
+
20
+ ```
21
+ warn test_client:encoder field 'Account' is not declared on Logon in this dictionary - it will not be sent
22
+ ```
23
+
24
+ That message means you need step (2) — a dictionary — not more code.
25
+
26
+ ---
27
+
28
+ ## Step 1 — put the field on the message
29
+
30
+ Three ways, in increasing order of effort. Use the first one that fits.
31
+
32
+ ### The `Logon` block (no code)
33
+
34
+ Name the extra fields under `Logon` in the session description. They are merged over
35
+ the fields the engine derives from the description, so you can add, override, or
36
+ suppress:
37
+
38
+ ```json
39
+ {
40
+ "application": {
41
+ "type": "initiator",
42
+ "name": "my_client",
43
+ "tcp": { "host": "fix.broker.com", "port": 10400 },
44
+ "protocol": "ascii",
45
+ "dictionary": "repo44"
46
+ },
47
+ "BeginString": "FIX4.4",
48
+ "SenderCompId": "TVKD",
49
+ "TargetCompID": "MXVMDGW",
50
+ "Password": "password",
51
+ "HeartBtInt": 30,
52
+ "ResetSeqNumFlag": true,
53
+
54
+ "Logon": {
55
+ "Account": "TVKD_001",
56
+ "DefaultApplVerID": "9"
57
+ }
58
+ }
59
+ ```
60
+
61
+ - **Add** a field — name it with its value.
62
+ - **Override** a field the engine derived — `"Logon": { "HeartBtInt": 60 }`.
63
+ - **Suppress** a field — `"Logon": { "Username": null }`. (Simply leaving `Username`
64
+ out of the description entirely has the same effect; a null or empty value is never
65
+ encoded.)
66
+
67
+ Note this block applies to the Logon your session *sends*. An acceptor sends a Logon
68
+ too — its response — so a block configured on an acceptor appears on that response.
69
+
70
+ `EncryptMethod` is a special case: the engine always derives `0` (None) and ignores a
71
+ top-level `"EncryptMethod"` in the description. Set it through the block if you need
72
+ another value.
73
+
74
+ ### An `ObjectMutator` (a callback)
75
+
76
+ When the values are computed at run time — a signature over the sequence number, a
77
+ nonce, a token fetched at start up — a static block will not do. Every session
78
+ message passes through the factory's mutator on its way out:
79
+
80
+ ```typescript
81
+ import { ObjectMutator, ISessionDescription, MsgType } from 'jspurefix'
82
+ import { ILooseObject } from 'jspurefix/dist/collections/collection'
83
+
84
+ const stampToken: ObjectMutator = (
85
+ description: ISessionDescription,
86
+ type: string,
87
+ o: ILooseObject): ILooseObject => {
88
+ if (type !== MsgType.Logon) return o
89
+ return { ...o, RawData: Buffer.from(signOn(description.SenderCompId)) }
90
+ }
91
+ ```
92
+
93
+ The mutator is a constructor argument to any factory deriving from
94
+ `ASessionMsgFactory`, so install it with the factory (next section). It also sees
95
+ `StandardHeader` (as type `'StandardHeader'`), Logout, TestRequest, Heartbeat,
96
+ ResendRequest, SequenceReset and Reject — which is what makes it the right hook for
97
+ anything a counterparty demands on *every* message.
98
+
99
+ ### Your own session message factory
100
+
101
+ Full control: subclass the stock factory and override `logon()`.
102
+
103
+ ```typescript
104
+ import { AsciiSessionMsgFactory } from 'jspurefix'
105
+ import { ILooseObject } from 'jspurefix/dist/collections/collection'
106
+
107
+ export class BrokerSessionMsgFactory extends AsciiSessionMsgFactory {
108
+ public logon (): ILooseObject {
109
+ return {
110
+ ...super.logon(),
111
+ Password: this.freshToken(),
112
+ Account: this.description.SenderCompId
113
+ }
114
+ }
115
+
116
+ private freshToken (): string { /* ... */ }
117
+ }
118
+ ```
119
+
120
+ Override `header()` the same way if a counterparty needs a header field on every
121
+ message. Call `super` and spread — do not rebuild the object from scratch, or you
122
+ will lose fields the engine relies on.
123
+
124
+ ## Installing your factory
125
+
126
+ The launcher you already subclass has one method for this:
127
+
128
+ ```typescript
129
+ class AppLauncher extends SessionLauncher {
130
+ protected override makeSessionMsgFactory (
131
+ description: ISessionDescription): ISessionMsgFactory | null {
132
+ return new BrokerSessionMsgFactory(description)
133
+ }
134
+ }
135
+ ```
136
+
137
+ Return `null` for the stock factory. If you build the container yourself, pass a
138
+ provider instead:
139
+
140
+ ```typescript
141
+ new SessionContainer(d => new BrokerSessionMsgFactory(d))
142
+ ```
143
+
144
+ Both work for initiators and acceptors. An acceptor builds one factory **per accepted
145
+ connection**, so that each session's headers carry its own comp ids; your factory is
146
+ carried into those per-connection scopes rather than being replaced by the stock one
147
+ ([#87](https://github.com/TimelordUK/jspurefix/issues/87)). That works automatically
148
+ for any factory whose constructor takes `(description, mutator)`. If yours takes
149
+ something else, override `cloneFor`:
150
+
151
+ ```typescript
152
+ public override cloneFor (description: ISessionDescription): ISessionMsgFactory {
153
+ return new MyFactory(description, this.apiKey)
154
+ }
155
+ ```
156
+
157
+ > Older advice in issue #39 — `sessionContainer.clearInstances()`, re-register, and
158
+ > rebuild `JsFixConfig` inside `registerApplication` — is obsolete and will fight the
159
+ > per-connection session scopes. Use `makeSessionMsgFactory`.
160
+
161
+ ---
162
+
163
+ ## Step 2 — declare the field in a dictionary
164
+
165
+ The encoder is dictionary driven. It resolves each key on your object to a field of
166
+ the message being encoded, and a key it cannot resolve has no tag, so it is dropped.
167
+ `Account` is tag 1, but it is **not a field of Logon** in standard FIX 4.4 — so
168
+ putting it on the Logon object achieves nothing on its own.
169
+
170
+ Copy the QuickFIX XML for your dialect, add the field to the Logon message, and point
171
+ the session at it:
172
+
173
+ ```xml
174
+ <message name='Logon' msgtype='A' msgcat='admin'>
175
+ <field name='EncryptMethod' required='Y' />
176
+ <field name='HeartBtInt' required='Y' />
177
+ <field name='ResetSeqNumFlag' required='N' />
178
+ <field name='Username' required='N' />
179
+ <field name='Password' required='N' />
180
+ <!-- what this counterparty demands -->
181
+ <field name='Account' required='N' />
182
+ <field name='DefaultApplVerID' required='N' />
183
+ </message>
184
+ ```
185
+
186
+ The field must also exist in the `<fields>` section of the same file:
187
+
188
+ ```xml
189
+ <field number='1' name='Account' type='STRING' />
190
+ ```
191
+
192
+ Then reference it from the session description:
193
+
194
+ ```json
195
+ { "application": { "dictionary": "/abs/path/to/FIX44-BROKER.xml" } }
196
+ ```
197
+
198
+ > **Path gotcha.** A *relative* dictionary path is resolved against the **jspurefix
199
+ > package root** (`node_modules/jspurefix`), not your project's working directory.
200
+ > Use an absolute path — `path.join(__dirname, 'dictionaries/FIX44-BROKER.xml')` —
201
+ > or register an alias in `data/dictionary.json` as described in the README under
202
+ > [Data Dictionaries](../README.md#data-dictionaries).
203
+
204
+ Generating typed interfaces for the dialect is optional — the engine reads the XML at
205
+ run time either way — but worth doing if you want `ILogon` to know about your field.
206
+
207
+ ## Checklist when a tag still is not on the wire
208
+
209
+ 1. Is there an `is not declared on Logon in this dictionary` warning in the log? →
210
+ the dictionary is the problem, not your code.
211
+ 2. Is the session actually loading the dictionary you edited? Relative paths resolve
212
+ against the package root — see above.
213
+ 3. Is the value `null`, `undefined` or `''`? Those are never encoded, by design.
214
+ 4. Are you customising a factory the acceptor then replaces? Implement `cloneFor` if
215
+ your constructor is not `(description, mutator)`.
216
+ 5. Turn on `logReceivedMsgs` / the `onEncoded` hook on your session and read the
217
+ encoded string directly — it is the ground truth.
218
+
219
+ ## See also
220
+
221
+ - [docs/acceptor.md](acceptor.md) — per-connection session scopes and why the factory
222
+ is cloned.
223
+ - `src/test/session/custom-logon.test.ts` — every behaviour above, exercised.
224
+ - `src/test/session/custom-session-msg-factory.test.ts` — factory survival into
225
+ acceptor scopes.
package/eslint.config.mjs CHANGED
@@ -106,6 +106,8 @@ export default [
106
106
  'prefer-template': 'off',
107
107
  'radix': 'off',
108
108
  'require-unicode-regexp': 'off',
109
+ // named capture groups need a target of es2018, this package emits es6
110
+ 'prefer-named-capture-group': 'off',
109
111
  'promise/avoid-new': 'off',
110
112
  'promise/no-multiple-resolved': 'off',
111
113
  'import/enforce-node-protocol-usage': 'off',
@@ -114,6 +116,18 @@ export default [
114
116
  }
115
117
  },
116
118
  {
117
- ignores: ['dist/**', 'node_modules/**']
119
+ files: ['src/test/**/*.ts'],
120
+ rules: {
121
+ // tests assert a value is present with expect(x).toBeDefined() and then use x!.
122
+ // the compiler cannot follow that, and rewriting each site as an explicit throw
123
+ // buries the assertion the test is actually about.
124
+ '@typescript-eslint/no-non-null-assertion': 'off',
125
+ // save/restore of a static around an awaited body is not a race in a jest file,
126
+ // which runs its tests serially.
127
+ 'require-atomic-updates': 'off'
128
+ }
129
+ },
130
+ {
131
+ ignores: ['dist/**', 'node_modules/**', 'coverage/**']
118
132
  }
119
133
  ]
@@ -1,62 +1,62 @@
1
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:15.489|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=104|
2
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:15.494|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=148|
3
- 8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260801-14:51:15.495|7=1|16=1|10=236|
4
- 8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260801-14:51:15.500|122=20260801-14:51:15.500|123=Y|36=2|10=077|
5
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:17.499|58=5|10=218|
6
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:20.313|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=086|
7
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:20.315|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=136|
8
- 8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260801-14:51:20.315|7=1|16=0|10=222|
9
- 8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260801-14:51:20.318|122=20260801-14:51:20.318|123=Y|36=2|10=083|
10
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:22.318|58=5|10=204|
11
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:24.804|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=095|
12
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:24.806|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=145|
13
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=2|57=fix|52=20260801-14:51:24.806|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=098|
14
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:25.344|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=095|
15
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:25.345|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=144|
16
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:26.347|58=5|10=210|
17
- 8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260801-14:51:26.807|58=5|10=212|
18
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:29.063|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=097|
19
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:29.065|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=147|
20
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:30.068|58=5|10=205|
21
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:32.552|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=094|
22
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:32.553|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=143|
23
- 8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=0|57=fix|52=20260801-14:51:33.554|58=5|10=206|
24
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:36.035|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=094|
25
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=5|57=fix|52=20260801-14:51:36.036|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=147|
26
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:37.039|58=5|10=210|
27
- 8=FIX.4.4|9=0000110|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:39.686|98=0|141=Y|553=js-client|554=pwd-client|10=177|
28
- 8=FIX.4.4|9=0000125|35=3|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:39.687|45=1|372=A|373=1|58=msgType A missing required tag 108|10=011|
29
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:44.447|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=100|
30
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:44.449|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=150|
31
- 8=FIX.4.4|9=0000111|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:44.451|45=2|372=ZZ|373=11|58=msgType ZZ unknown|10=144|
32
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260801-14:51:46.451|58=5|10=209|
33
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:48.955|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=108|
34
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:48.956|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=157|
35
- 8=FIX.4.4|9=0000146|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:48.958|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 143|10=081|
36
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260801-14:51:50.959|58=5|10=217|
37
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:52.957|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=105|
38
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:51:57.567|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=107|
39
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:51:57.568|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=156|
40
- 8=FIX.4.4|9=0000145|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:51:57.569|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 59|10=036|
41
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260801-14:51:59.570|58=5|10=215|
42
- 8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:52:02.309|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=042|
43
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:52:02.310|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=132|
44
- 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260801-14:52:04.315|112=Sat, 01 Aug 2026 14:52:04 GMT|10=120|
45
- 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260801-14:52:06.317|112=Sat, 01 Aug 2026 14:52:06 GMT|10=127|
46
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:52:08.313|58=5|10=204|
47
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:52:10.828|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=097|
48
- 8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:52:10.829|98=0|108=2|141=Y|553=js-server|554=pwd-server|10=096|
49
- 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:52:12.833|112=Sat, 01 Aug 2026 14:52:12 GMT|10=123|
50
- 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=3|57=fix|52=20260801-14:52:14.838|112=Sat, 01 Aug 2026 14:52:14 GMT|10=133|
51
- 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=4|57=fix|52=20260801-14:52:16.841|112=Sat, 01 Aug 2026 14:52:16 GMT|10=132|
52
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=5|57=fix|52=20260801-14:52:18.831|58=5|10=213|
53
- 8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:52:21.327|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=043|
54
- 8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:52:21.328|98=0|108=5|141=Y|553=js-server|554=pwd-server|10=095|
55
- 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260801-14:52:23.334|112=Sat, 01 Aug 2026 14:52:23 GMT|10=123|
56
- 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260801-14:52:25.336|112=Sat, 01 Aug 2026 14:52:25 GMT|10=130|
57
- 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:52:26.339|112=Sat, 01 Aug 2026 14:52:26 GMT|10=134|
58
- 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=4|57=fix|52=20260801-14:52:27.338|112=Sat, 01 Aug 2026 14:52:27 GMT|10=137|
59
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260801-14:52:29.330|58=5|10=207|
60
- 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260801-14:54:22.785|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=104|
61
- 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260801-14:54:22.794|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=152|
62
- 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260801-14:54:23.799|58=5|10=221|
1
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:37.235|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=111|
2
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-13:59:37.240|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=155|
3
+ 8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260808-13:59:37.241|7=1|16=1|10=243|
4
+ 8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260808-13:59:37.245|122=20260808-13:59:37.245|123=Y|36=2|10=125|
5
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-13:59:39.246|58=5|10=226|
6
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:42.038|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=108|
7
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-13:59:42.040|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=149|
8
+ 8=FIX.4.4|9=0000079|35=2|49=init-comp|56=accept-comp|34=2|57=fix|52=20260808-13:59:42.041|7=1|16=0|10=236|
9
+ 8=FIX.4.4|9=0000112|35=4|49=accept-comp|56=init-comp|34=1|57=fix|43=Y|52=20260808-13:59:42.043|122=20260808-13:59:42.043|123=Y|36=2|10=109|
10
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-13:59:44.043|58=5|10=217|
11
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:46.524|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=112|
12
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-13:59:46.526|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=162|
13
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=2|57=fix|52=20260808-13:59:46.526|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=115|
14
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:47.064|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=112|
15
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-13:59:47.066|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=162|
16
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-13:59:48.068|58=5|10=228|
17
+ 8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=3|57=fix|52=20260808-13:59:48.527|58=5|10=229|
18
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:50.829|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=115|
19
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-13:59:50.830|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=155|
20
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-13:59:51.832|58=5|10=221|
21
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:54.326|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=111|
22
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-13:59:54.327|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=160|
23
+ 8=FIX.4.4|9=0000075|35=5|49=init-comp|56=accept-comp|34=0|57=fix|52=20260808-13:59:55.328|58=5|10=223|
24
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-13:59:57.802|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=113|
25
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=5|57=fix|52=20260808-13:59:57.803|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=166|
26
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-13:59:58.805|58=5|10=228|
27
+ 8=FIX.4.4|9=0000110|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:01.434|98=0|141=Y|553=js-client|554=pwd-client|10=158|
28
+ 8=FIX.4.4|9=0000125|35=3|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:01.435|45=1|372=A|373=1|58=msgType A missing required tag 108|10=248|
29
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:06.211|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=088|
30
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:06.213|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=138|
31
+ 8=FIX.4.4|9=0000111|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:00:06.214|45=2|372=ZZ|373=11|58=msgType ZZ unknown|10=140|
32
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260808-14:00:08.215|58=5|10=206|
33
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:10.703|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=089|
34
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:10.704|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=138|
35
+ 8=FIX.4.4|9=0000146|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:00:10.705|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 143|10=061|
36
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260808-14:00:12.705|58=5|10=205|
37
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:14.705|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=095|
38
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:19.323|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=096|
39
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:19.324|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=145|
40
+ 8=FIX.4.4|9=0000145|35=3|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:00:19.326|45=2|372=0|373=5|58=msgType 0 checksum failed. received = 95 computed = 59|10=026|
41
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260808-14:00:21.326|58=5|10=204|
42
+ 8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:24.088|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=050|
43
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:24.089|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=149|
44
+ 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260808-14:00:26.095|112=Sat, 08 Aug 2026 14:00:26 GMT|10=133|
45
+ 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260808-14:00:28.099|112=Sat, 08 Aug 2026 14:00:28 GMT|10=142|
46
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:00:30.091|58=5|10=202|
47
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:32.593|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=100|
48
+ 8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:32.594|98=0|108=2|141=Y|553=js-server|554=pwd-server|10=099|
49
+ 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:00:34.598|112=Sat, 08 Aug 2026 14:00:34 GMT|10=139|
50
+ 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=3|57=fix|52=20260808-14:00:36.602|112=Sat, 08 Aug 2026 14:00:36 GMT|10=130|
51
+ 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=4|57=fix|52=20260808-14:00:38.606|112=Sat, 08 Aug 2026 14:00:38 GMT|10=139|
52
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=5|57=fix|52=20260808-14:00:40.596|58=5|10=216|
53
+ 8=FIX.4.4|9=0000116|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:00:43.075|98=0|108=2|141=Y|553=js-client|554=pwd-client|10=047|
54
+ 8=FIX.4.4|9=0000116|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:00:43.077|98=0|108=5|141=Y|553=js-server|554=pwd-server|10=100|
55
+ 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=2|57=fix|52=20260808-14:00:45.081|112=Sat, 08 Aug 2026 14:00:45 GMT|10=130|
56
+ 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=3|57=fix|52=20260808-14:00:47.086|112=Sat, 08 Aug 2026 14:00:47 GMT|10=140|
57
+ 8=FIX.4.4|9=0000104|35=0|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:00:48.087|112=Sat, 08 Aug 2026 14:00:48 GMT|10=142|
58
+ 8=FIX.4.4|9=0000104|35=0|49=init-comp|56=accept-comp|34=4|57=fix|52=20260808-14:00:49.089|112=Sat, 08 Aug 2026 14:00:49 GMT|10=148|
59
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=3|57=fix|52=20260808-14:00:51.078|58=5|10=211|
60
+ 8=FIX.4.4|9=0000117|35=A|49=init-comp|56=accept-comp|34=1|57=fix|52=20260808-14:03:01.489|98=0|108=30|141=Y|553=js-client|554=pwd-client|10=103|
61
+ 8=FIX.4.4|9=0000117|35=A|49=accept-comp|56=init-comp|34=1|57=fix|52=20260808-14:03:01.499|98=0|108=30|141=Y|553=js-server|554=pwd-server|10=152|
62
+ 8=FIX.4.4|9=0000075|35=5|49=accept-comp|56=init-comp|34=2|57=fix|52=20260808-14:03:02.504|58=5|10=203|