Skip to content

Fix kafka-offsetrepository example: single broker, gitignore offset file - #199

Open
Croway wants to merge 1 commit into
apache:mainfrom
Croway:fix-kafka-offsetrepository
Open

Fix kafka-offsetrepository example: single broker, gitignore offset file#199
Croway wants to merge 1 commit into
apache:mainfrom
Croway:fix-kafka-offsetrepository

Conversation

@Croway

@Croway Croway commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • kafka.bootstrap.url in the kafka-offsetrepository example listed a 3-broker cluster (localhost:9092,9093,9094), but the README's camel infra run kafka only starts a single broker — this produced noisy but harmless connection WARNs. Simplified to localhost:9092.
  • fileOffsetrepoPath pointed at a tracked file under src/main/resources/offsetStateRepo.dat, which running the example mutates, dirtying git status on every run. Moved it to target/offsetStateRepo.dat (already covered by the repo's target gitignore rule) and removed the tracked file.

Test plan

  • mvn compile succeeds
  • Started a single-broker Kafka via camel infra run kafka and confirmed only one broker container comes up on port 9092
  • Ran mvn spring-boot:run: producer/consumer routes exchange messages with no broker-connection WARNs
  • Confirmed offsetStateRepo.dat is written to target/ and git status stays clean after a run

🤖 Generated with Claude Code

https://claude.ai/code/session_01Tgb2b9DSh1ncG7C82rwzsE

…file

- kafka.bootstrap.url now lists a single broker (localhost:9092) to
  match `camel infra run kafka`, which only starts one broker. The
  previous 3-broker list caused harmless but noisy connection WARNs.
- fileOffsetrepoPath now points under target/ instead of
  src/main/resources, and the previously tracked offsetStateRepo.dat
  is removed from git. Running the example mutated this file, dirtying
  the working tree on every run; target/ is already gitignored.

Verified by running `camel infra run kafka` (single broker on 9092)
and `mvn spring-boot:run`: producer/consumer routes work with no
broker WARNs, and offsetStateRepo.dat is written to target/ leaving
git status clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tgb2b9DSh1ncG7C82rwzsE
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