-
Notifications
You must be signed in to change notification settings - Fork 14
Description
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 eventsinventory:eventPublisher:InventoryEventPublisher→ 1 eventpayment: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.