Skip to content

E2E test: Subscribe with OffsetSpec::timestamp() — time-based offset#316

Closed
s2x wants to merge 1 commit intomainfrom
oda-155-e2e-test-subscribe-with-offsetspec-times
Closed

E2E test: Subscribe with OffsetSpec::timestamp() — time-based offset#316
s2x wants to merge 1 commit intomainfrom
oda-155-e2e-test-subscribe-with-offsetspec-times

Conversation

@s2x
Copy link
Copy Markdown
Contributor

@s2x s2x commented Mar 30, 2026

Closes #155

Problem

OffsetSpec supports TYPE_TIMESTAMP (0x0005) for time-based subscriptions, but no E2E test exercises this path. Time-based offset is important for replaying messages from a specific point in time.

Expected test

public function testSubscribeFromTimestamp(): void
{
    // 1. Publish messages
    // 2. Record current timestamp
    // 3. Publish more messages
    // 4. Subscribe with OffsetSpec::timestamp($recordedTimestamp)
    // 5. Verify only messages after the timestamp are received
}

Why it matters

  • Time-based replay is a key feature of RabbitMQ Streams
  • The OffsetSpec::timestamp() factory method exists but is untested E2E
  • Serialization of timestamp offset type differs from other types

Acceptance criteria

  • Subscribe with a past timestamp → receive messages from that point
  • Subscribe with a future timestamp → receive no messages (timeout)
  • Verify timestamp is correctly serialized as milliseconds since epoch

Add two new test methods to verify timestamp-based subscription:
- testSubscribeFromTimestamp(): Verifies messages published after timestamp are received
- testSubscribeFromFutureTimestamp(): Verifies no messages received from future timestamp

Uses higher-level Connection API for proper async frame handling.
@s2x s2x closed this Mar 30, 2026
@s2x s2x deleted the oda-155-e2e-test-subscribe-with-offsetspec-times branch March 30, 2026 15:32
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.

E2E test: Subscribe with OffsetSpec::timestamp() — time-based offset

1 participant