kafka-unit icon indicating copy to clipboard operation
kafka-unit copied to clipboard

A way to reset received events

Open mohamnag opened this issue 9 years ago • 0 comments

I'm using this library to check for events published as messages during integration tests. The problem is however that in many tests I'm not interested in all of the events published but only some which are published from an specific point until now.

The read messages does not provide a way to set a position or skip events until an specific point. It would be great if it was possible to reset events or set the consumer to the end of messages at some point. As a result the next read message will get only the last x messages.

Currently to solve this problem I'm using a consumer in a separate thread which is receiving all the events into a list that can be cleared any time to get future events in an empty list.

mohamnag avatar Jul 12 '16 18:07 mohamnag