Marcin-Pankowski commented on PR #7313:
URL: https://github.com/apache/incubator-kie/pull/7313#issuecomment-7126717895
@martinweiler @Abhitocode thanks a lot for the reviews and the kind words!
I pushed a follow-up commit:
- `waitingForEventType` / `clearEventTypes` read the events record with
`getStore().get(getKeyForEvents())` instead of `prefixScan`, so no iterator is
involved anymore. The three unit tests that stubbed `prefixScan("events")` no
longer need that stub (strict Mockito stubbing would fail on it), so I removed
it.
- `findByBusinessKey`: following the +1 on Martin's point, I fixed it in the
default method of `ProcessInstances` rather than overriding it in the Kafka
class, wrapping `stream(mode)` in try-with-resources. That covers every
implementation that relies on the default and releases resources in `onClose`
(Kafka, RocksDB, Infinispan with locking). JDBC and MongoDB override the method
anyway, and for implementations without close handlers closing the stream is a
no-op. The returned instance is already unmarshalled when the stream is closed.
`KafkaProcessInstancesTest` passes locally (15/15); I did not run the ITs.
Since this touches `kogito-api`, I'm happy to move the `ProcessInstances`
change into a separate issue/PR if you prefer to keep this one Kafka-only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]