Hi Flink team, I'm evaluating Flink CEP for financ...
# troubleshooting
r
Hi Flink team, I'm evaluating Flink CEP for financial event processing. Currently using Esper but exploring alternatives. Core Requirements (with examples) 1. Event netting/aggregation ◦ Example: Events A(strategy="Alpha", date="2025-03-13"), B(strategy="Alpha", date="2025-03-13", exchange="NYSE"), and C(strategy="Alpha", hash="abc123") combine to create a single StrategyReadyEvent 2. Strict event ordering support, should also be able to support unordered events ◦ Example: Detect price validation only when events arrive in sequence: PriceSync → VolumeSync → Validation 3. Multiple pattern matches from same event instances ◦ Example: Same events A and B can participate in both "A→B→C1" and "A→B→C2" patterns simultaneously (e.g., same strategy initialization followed by different validation events) 4. Time-windowed pattern detection ◦ Example: Events A, B, C only combine if they all occur within a 48-hour window 5. JSON-based pattern definitions ◦ Example: See pattern below that should be convertible to Flink CEP API code Sample Pattern JSON
Copy code
{
  "patternId": "STRATEGY_READY",
  "description": "Strategy deployment readiness check",
  "version": "1.0",
  "enabled": true,
  "enforceEventOrder": false,
  "timeWindow": "48h",
  "allowEventReuse": true,
  "events": [
    {
      "id": "a",
      "type": "EventA"
    },
    {
      "id": "b",
      "type": "EventB"
    },
    {
      "id": "c",
      "type": "EventC"
    }
  ],
  "correlationRules": {
    "strategy": [
      "a",
      "b",
      "c"
    ],
    "date": [
      "a",
      "b"
    ]
  },
  "outputEvent": {
    "type": "StrategyReadyEvent",
    "mapping": {
      "date": "a.date",
      "strategy": "a.strategy",
      "exchange": "b.exchange",
      "hash": "c.hash"
    }
  }
}
Questions 1. Does Flink CEP have tools to convert JSON pattern definitions into Flink pattern API calls? 2. If not, what's the recommended approach for building such a converter? 3. Any examples of similar pattern-to-CEP conversion implementations? Thanks for your help!