Skip to content

Add event-correlator gateway plugin#20

Open
raphael-solace wants to merge 3 commits into
solacecommunity:mainfrom
raphael-solace:feat/event-correlator-gateway
Open

Add event-correlator gateway plugin#20
raphael-solace wants to merge 3 commits into
solacecommunity:mainfrom
raphael-solace:feat/event-correlator-gateway

Conversation

@raphael-solace

Copy link
Copy Markdown

Summary

A new Gateway Plugin that correlates events from N source systems by a shared key (orderId, tradeId, requestId, etc.) and triggers a downstream agent via A2A when configurable conditions are met.

Use cases

  • Trade/order reconciliation across multiple systems
  • Multi-system event matching (e.g., order placed + payment received + shipment dispatched)
  • Distributed transaction tracking
  • Any workflow where events from independent sources must be joined before an agent processes them

Features

  • Configurable source systems (any number) with Solace topic subscriptions
  • Correlation key extraction via JSON path or topic position
  • Two built-in trigger rules (extensible):
    • all_sources_present: fire when every configured source has published
    • immediate_on_source: fire immediately on a specific source/topic pattern (e.g., change events)
  • Pluggable state store (in-memory for dev, Redis for production)
  • Idempotent trigger evaluation (no double-firing on message redelivery)
  • Configurable TTL with expiry actions (drop, alert, trigger with partial data)
  • Output publishing to configurable Solace topics after agent completes
  • Extends BaseGatewayComponent following the same pattern as sam-event-mesh-gateway

Architecture

Source A ──► Solace Broker ──┐
Source B ──► Solace Broker ──┼──► Event Correlator Gateway ──► Agent (A2A)
Source C ──► Solace Broker ──┘         │
                                       ▼
                                 State Store
                               (InMemory/Redis)

Test plan

  • 45 unit and integration tests passing (pytest)
  • Lint clean (ruff check)
  • Verified plugin loads correctly in SAM framework (BaseGatewayApp + BaseGatewayComponent class hierarchy)
  • End-to-end tested with a real Solace broker: events published → correlated → trigger fired → submit_a2a_task() invoked
  • Reviewer: verify config.yaml example makes sense for your use case

🤖 Generated with Claude Code

raphael-solace and others added 3 commits May 26, 2026 11:37
A SAM Gateway plugin that correlates events from N source systems
by a shared key (orderId, tradeId, etc.) and triggers a downstream
agent via A2A when configurable conditions are met.

Features:
- Configurable source systems with topic subscriptions
- Correlation key extraction via JSON path or topic position
- Two built-in trigger rules: all-sources-present and immediate-on-source
- Pluggable state store (in-memory / Redis)
- Idempotent trigger evaluation
- Output publishing to configurable Solace topics
- 45 unit and integration tests

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a third state store option (`type: "database"`) that uses SAM's
built-in CacheService with SQLAlchemy (PostgreSQL/SQLite). This lets
the correlator persist state using the same database infrastructure
as SAM without requiring a separate Redis deployment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Standalone script that starts the correlator with a real Solace
broker, publishes test events, and verifies both trigger rules
fire correctly. Run with: python tests/e2e_local_test.py

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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