Skip to content

Add architectural guidance for sportsbook feed event sourcing#1

Draft
Copilot wants to merge 1 commit intomasterfrom
copilot/develop-feed-status-tracking
Draft

Add architectural guidance for sportsbook feed event sourcing#1
Copilot wants to merge 1 commit intomasterfrom
copilot/develop-feed-status-tracking

Conversation

Copy link

Copilot AI commented Feb 4, 2026

The problem statement requested architectural opinion on building an event sourcing application for sportsbook feed processing, not implementation.

Architecture Overview

Message Types: Define hierarchy with MatchMessage, FeedControlMessage, KeepAliveMessage extending base FeedMessage.

Feed State Management: Track last message timestamp, feed status (ACTIVE/INACTIVE/STALE/ERROR), betting status, and last KeepAlive separately. Use thread-safe constructs (AtomicReference, synchronized blocks).

Core Components:

  • FeedMessageParser: Parse and route by type
  • FeedStateManager: Thread-safe singleton for state
  • MessagePartitioner: Hash-based partitioning on match ID
  • FeedStatusMonitor: @Scheduled periodic health checks
  • DownstreamPublisher: Push status to consumers

State Transitions:

INACTIVE → ACTIVE: First message received
ACTIVE → STALE: Timeout without message/KeepAlive
STALE → ACTIVE: New message arrives

Key Decisions:

  • Use Spring @EnableScheduling for periodic status publishing
  • Configurable timeouts for KeepAlive vs message detection
  • Atomic state capture to avoid race conditions between scheduler and message processor
  • Consider event store for true event sourcing with replay capability

No implementation provided per request for opinion only.

Original prompt

I'm developing an even sourcing application for consuming sportsbook feed with changes on matches. That feed sends different type of messages. Apart from messages that carry on information about matches, it sens some feed level messages to stop and start betting as well as keep alive message to signale that the producer of the feed is still alive. Keep Alive message is sent only if there are not other messages being published. My application has to maintain the state of the feed and send that information downstream so that downstream services knows about the feed status. The basica processing logic is to parse the messages, assign them to a particular group/partition (fixed number of groups) and sent them downstream.

I'm expecting that I have to keep that state on the feed level and have a scheduler that will published feed status message in regular times after checking the status of the feed.

What would be your suggestion for this problem


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI requested a review from vasoz February 4, 2026 08:03
Copilot stopped work on behalf of vasoz due to an error February 4, 2026 08:03
Copilot AI changed the title [WIP] Add feed status tracking and scheduling logic Add architectural guidance for sportsbook feed event sourcing Feb 4, 2026
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.

2 participants