jackdaw

https://github.com/FundingCircle/jackdaw
finchharold 2021-05-05T04:17:30.141100Z

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?

finchharold 2021-05-05T11:27:13.141600Z

ohkay, thank you.

gklijs 2021-05-05T04:42:49.141200Z

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.

gklijs 2021-05-05T15:15:20.146100Z

I don’t think so, because the streamer is running in de different thread.

finchharold 2021-05-05T15:15:57.146300Z

Could you please elaborate?

finchharold 2021-05-05T15:17:26.146500Z

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?

gklijs 2021-05-05T15:40:26.146800Z

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.

finchharold 2021-05-05T16:12:02.147Z

okay, thank you.

gklijs 2021-05-05T16:59:48.147400Z

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.