I am currently working on a Spring boot application using Spring Kafka Consumer API.
Each message I get on to a topic needs to be converted into a new object type with additional properties coming in from other topics. Currently, these other topics are not yet developed and we are using a mocked version of in-memory data for processing the requests.
For example, a new "shopping order" message arrives, but I am using mocked "Customer" object and mocked "item" object in order to process the order. The plan is to move to use real Customer topic and real Item topic.
Also, currently, the application is only Spring Kafka listeners for getting new order. The listeners invoke a spring bean method which processes the order and creates a new object to be written to another output topic named customer-order by using the same mocks I mentioned above.
We are currently thinking about evolving the architecture for this application. I have been reading up on Kafka streams. The documentation I have read online for streams only take simple examples such as word count, join etc. With my limited knowledge of streams, I don't envision using functionality such as calculating total etc.
I have thought of some options for the architecture...
What do you suggest? 1,2, or 3? Is that a good idea to use Streams for this kind of solution? Is there any benefit in moving this implementation to use Kafka streaming? Or am I better of staying with 2.?
Number 1 sounds strange to me. You can keep a KafkaStreams application exposing state stores via Interactive Queries, but that would look more like a flavour of 2. You'll have to take into account also how you deploy your instances and ensure co-partitioning between the Spring part and the KafkaStreams part.
I don't see any problem in doing it in Kafka Streams fully, unless you have some very complex logic you cannot implement with current API, which I'd be surprised to learn you couldn't. Actually what you described sounds like a usual application for it (with the caveat of not knowing other requirements like time, expected volumes, etc).
Benefits:
Cons:
This is not a comprehensive list, but it's the most important points from the top of my head.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.