Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java subscriber consumed from oldest message rather than latest #3934

Closed
matt2e opened this issue Jan 7, 2025 · 2 comments
Closed

Java subscriber consumed from oldest message rather than latest #3934

matt2e opened this issue Jan 7, 2025 · 2 comments
Assignees

Comments

@matt2e
Copy link
Collaborator

matt2e commented Jan 7, 2025

In Stuart's demo, his subscriber was configured to read from the latest message but ended up consuming from the oldest

@matt2e matt2e self-assigned this Jan 7, 2025
@alecthomas alecthomas mentioned this issue Jan 7, 2025
@matt2e
Copy link
Collaborator Author

matt2e commented Jan 7, 2025

I can't repro this.
Tried the following

  • ftl dev backend/runner/pubsub/testdata/java
  • In console, call publisher.publishTen a few times. Confirm that subscribers consume the events that were published
  • In backend/runner/pubsub/testdata/java/subscriber/src/main/java/xyz/block/ftl/java/test/subscriber/Subscriber.java:
    • Duplicate the function consumeFromLatest and rename it to something like consumeFromLatest2
    • Save
  • FTL deploys the new code. consumeFromlatest2 does not consume any old events immediately.
  • Call publisher.publishOne. consumeFromlatest2 consumes one event (as do other subs)

Alternative theory: Stuart had done a dry runthrough before the recording where he had created the same module + topic + subscription names. That meant that when he wrote the code in the recording there was already an existing consumer group with an existing offset in redpanda. So the LATEST option was never actually used.
@stuartwdouglas I know it'll been a while since you recorded when you come back from your break, but do you remember?

@matt2e matt2e assigned stuartwdouglas and unassigned matt2e Jan 7, 2025
@matt2e
Copy link
Collaborator Author

matt2e commented Jan 13, 2025

Closing: Stuart confirmed that he made the same subscription before the video recording

@matt2e matt2e closed this as completed Jan 13, 2025
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

No branches or pull requests

2 participants