Is polling multiple times a bad thing? Like, I'm running the poll method multiple times now and it is showing Kafka isn't safe for multi-threads but still, it works though, but will it eventually break?
ohkay, thank you.
What they say is, the consumer is not thread safe. But using it from Clojure I'm not sure there is a problem. One of the main problems would be with commiting offsets. It's easy to accidentally commit messages that aren't handled yet when used be multiple threads. There might also be issues with rebalancing and other unhappy paths.
I don’t think so, because the streamer is running in de different thread.
Could you please elaborate?
I can run the poll method inside the mutation and it works fine but what changes in the case of using it inside a streamer?
Streamer is async and stuff. I don’t have time now to take a good look. I know my example works, but its been a while I worked on it, sorry.
okay, thank you.
How I solved it was running the poll seperate, and have the source-stream
in a map which is updated on subscribe/close. https://github.com/gklijs/bkes-demo/blob/7d86b9b2ef2b014c0ef85b045de8559013d9e9ee/graphql-endpoint/src/nl/openweb/graphql_endpoint/transaction_service.clj#L100.