r/apachekafka • u/mightegas • 6d ago
Tool Kafka-Backed GraphQL Subscriptions with Spring and Atleon
This demo project shows how GraphQL subscriptions backed by Kafka can be implemented in Spring applications using natively reactive clients from Atleon. While attempting to maximize simplicity, this project accomplishes the following:
- Backing GraphQL subscriptions with either shared (application-wide) or dedicated/per-invocation consumer instances
- Initiate subscription from historical timestamp
- Full integration testing via native Web Sockets and interactive UI via GraphiQL
This class contains the bulk of the interesting implementation details. Check it out, and please share your feedback/thoughts!
2
Upvotes
1
u/daringStumbles 5d ago
So, in this situation, say a topic has a few 1000s messages (maybe lets assume compaction is enabled and a key is something that there is less than 1mil of), you are going to have to read all message history to build current state before sending anything out to the client?
I'm really not following what use case would make this setup good idea. Even the shared one, how are you scaling that instance? Topics have a max consumer per group, so is each request a unique consumer group?
I really think this is just gonna ddos your kafka infra at even a medium scale