I am having a few conceptual mind-blocks. I am looking at using Kafka as below:
---http-requests---> [Web Tier]
[Web Tier] ----composes message and publishes----> [Kafka Topic]
[Kafka Topic] <----consumes message------ [Engine Logic]
[Engine Logic] -----computes, api-calls, publishes result message----> [Kafka Topic]
[Kafka] ---???? somehow get result message to Web Tier---> [Web Tier]
[Web Tier] -----renders HTML and sends http response--->
Using a non-blocking webserver (such as Jetty) the http request will be 'held open' but won't block. Is it possible to use Kafka in a request/response fashion? That is to say, can the Web Tier publish a message to a Topic and then will Kafka know that it must provide a response? Or is it going to be the Web Tier's responsibility to poll a Topic and see if there is a response for it?
I guess what I am asking is what is the best way to use Kafka as an 'interface' upon which the Web Tier and Engine Logic depend so that there is no direct coupling between the Web Tier and the Engine? Thanks.