Hi, A request-response structure is more suitable for your scenario, you should still persist RESTful API rather than Kafka.
1095193...@qq.com From: Desmond Lim Date: 2019-03-19 09:52 To: users Subject: Using kafka with RESTful API Hi all, Just started using kafka yesterday and I have this question. I have a RESTful API that gets JSON data from a user (via POST) passes it to an app, the app computes the data and return it to the RESTful API and the API would display the results to the user. I'm trying to do this: The RESTful API would send the data to kafka. The app will get the data, compute and return the results to the user. The sending to kafka and the app, that I know how to do, I'm stuck at the second part. How can I get the return results back to the RESTful API? There are 2 scenarios: 1. It returns it via kafka again, the RESTful API will get the data and return. But I can't understand how this would work in a queue? If I have 5 users using it, how can I ensure that the right result gets returned to the right user? Also, I assume that I need a while loop to check the kafka topic while it waits for the results. 2. The second, is not to use kafka at all for the returning of results but I don't know how it can be done and I think that it would make this really complex (I might be wrong). Any help would be appreciated. Thanks. Desmond