Closed szoio closed 5 years ago
I started looking into this. We may have to convert the Kafka consumer code to a Processor so that it is part of the Topology.
I agree. If it forms part of the topology it will be easier to test. That's probably the right way to do it in any case.
Currently a dead-end :( https://issues.apache.org/jira/browse/KAFKA-6989
Basically what happens is when the "process" method returns, the "current node" is removed from the context, and you can no longer use it to "forward" messages. So when the async action completes on a new thread, the context is in that state with no current node, and forwarding fails.
That's too bad. What we have currently does work, but it steps outside the Kafka Streams world, so it's a) not that easy to test with the TopologyTestDriver
and b) cannot offer the same consistency guarantee, though it might be sufficiently robust for pretty much any real application, provided the action itself is idempotent.
It may be possible to partially test with the TopologyTestDriver.
Add test coverage for the async action processor.