Skip to content

typescript: join a message key's sender to its handler (remote_edge) - #1822

Merged
swapnilpaliwal-sd merged 2 commits into
apps/integration-0.1.9from
apps/typescript/ts-message-broker-join
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
apps/integration-0.1.9from
apps/typescript/ts-message-broker-join

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

A send on a message key (Nest microservices client emit/send, kafkajs producer.send({ topic })) was never joined to the handler on the same key (@EventPattern/@MessagePattern, kafkajs consumer.subscribe). path stopped at the send; impact of a handler named no sender.

  • destinations.dl: new messaging section emitting remote_edge (transport from the decorator's Transport.X, or message when neither end names one), plus remote_unserved / remote_unsent / remote_undetermined.
  • Both ends are recognised by the receiver's declared type and the package it is imported from (knobs.dl, ts_msg_client_type), never by method name. So EventEmitter.emit is not a send.
  • Keys are read as routes already are: literal, const, const-object member (now also through as const), local or imported across packages.
  • One wrapper hop is bound: place() { this.send(CMD.place, x) } over send(pattern, x) { this.proxy.send(pattern, x) } joins from place.
  • remote_unsent is judged by destination, so a handler reached by a send that names no broker is not also reported unsent.

Checked: new case cross-process-message fails 5/7 before the fix and passes 7/7 after (controls: EventEmitter emit, a handler nobody sends to). TS case suite 212/212, engine suite 99/0. On a 3-service monorepo, probes went from 44 to 47 of 74 with no regression. Call edges are unchanged (10045) and the HTTP remote rows are unchanged; 5 amqp + 2 kafka edges were added.

A producer that emits on a key (a Nest microservices client's emit/send, a
kafkajs producer's send({ topic })) was not joined to the handler registered
on the same key (@EventPattern / @MessagePattern, a kafkajs consumer's
subscribe), so path stopped at the send and impact of a handler named no
sender.

destinations.dl gains a messaging section. Both ends are recognised by the
receiver's DECLARED type and the package it is imported from (knobs.dl,
ts_msg_client_type), never by the method name, so emit on a Node event
emitter is not a send. The key is read the way a route is: a literal, a
const, a const-object member (now also through `as const`), local or
imported. One wrapper hop is bound: a private send(pattern, x) called with
the key joins from its caller. A decorator's Transport argument names the
broker; an end that names none joins any. One-sided keys are reported as
remote_unserved / remote_unsent, an unreadable key as remote_undetermined.
remote_unsent is judged by destination, so a handler reached by a send that
names no broker is not also reported unsent.

Checked: new CLI case cross-process-message (emit on an imported const-object
member, send on a const, a key through a wrapper, kafkajs send/subscribe,
controls: an EventEmitter emit and a handler nobody sends to) fails 5/7
before and passes 7/7; typescript case suite 212/212, engine suite 99/0. On a
monorepo with three services: probes 44 -> 47 of 74, no regression, call
edges unchanged, 5 amqp + 2 kafka remote edges added.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 4f8bd3b into apps/integration-0.1.9 Sep 30, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/typescript/ts-message-broker-join branch September 30, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant