Skip to content

Connection detection hard-codes metadata key names instead of reading from extraction config #273

@NTCoding

Description

@NTCoding

Problem

detectPublishConnections and detectSubscribeConnections hard-code metadata key names (publishedEventType, subscribedEvents, eventName) as string literals. These keys are defined in extraction config files — the connection detection code should read from the config, not assume a fixed metadata shape.

This violates the config-driven extraction principle: the extraction config is the source of truth for what gets extracted and how it's named.

Impact

Class-level eventPublisher components (e.g. ShippingEventPublisher) that publish multiple events cannot work with the current model. detectPublishConnections expects a single publishedEventType string per component. A class publishing 3 events needs 3 links, but the hard-coded single-key assumption prevents this.

The ecommerce-demo-app has 7 publisher→event connections that fail because of this:

  • shipping:eventPublisher:ShippingEventPublisher → 3 events
  • inventory:eventPublisher:InventoryEventPublisher → 1 event
  • payment:eventPublisher:PaymentEventPublisher → 3 events

Hard-coded references

detect-publish-connections.ts:

  • publisher.metadata['publishedEventType'] (line 19)
  • e.metadata['eventName'] (line 63)

detect-subscribe-connections.ts:

  • handler.metadata['subscribedEvents']
  • e.metadata['eventName']

Expected behaviour

Connection detection should be driven by the extraction config, not by hard-coded key names. The config already defines what metadata keys exist and how to extract them — connection detection should use that same config to know which keys to match on.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions