-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KafkaMessageFilteringConsumer#findMessageWithTimeout concurrent access #1281
Comments
thanks @tschlat. I will fix it by next week. |
…a consumer added a reproducer for citrusframework#1281. indeed the test which is part of the `KafkaEndpointJavaIT` throws: ```shell java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access. currentThread(name: Thread-1, id: 124) otherThread(id: 125) ```
…a consumer added a reproducer for citrusframework#1281. indeed the test which is part of the `KafkaEndpointJavaIT` throws: ```shell java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access. currentThread(name: Thread-1, id: 124) otherThread(id: 125) ```
Just wanted to note this down here...
That's not the source of the problem (although the order of shutdown might be wrong in this case). There are numerous threads and only one consumer which is not thread-safe. I've fixed this in the |
…a consumer added a reproducer for citrusframework#1281. indeed the test which is part of the `KafkaEndpointJavaIT` throws: ```shell java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access. currentThread(name: Thread-1, id: 124) otherThread(id: 125) ```
…a consumer added a reproducer for citrusframework#1281. indeed the test which is part of the `KafkaEndpointJavaIT` throws: ```shell java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access. currentThread(name: Thread-1, id: 124) otherThread(id: 125) ```
Citrus Version
4.4
Expected behavior
KafkaMessageFilteringConsumer should poll messages without running into exceptions.
Actual behavior
Consumer runs into the following exception:
The Reason is, that the conusmer is queried asynchronously here:
KafkaMessageFilteringConsumer#findMessageWithTimeout:
and then here from the main thread:
When the consumber is unsubscribed, it is still locked by the asynchonous thread. So before unsubscription, we need a sync here to make sure the consumer is not in use any more.
Test case sample
The text was updated successfully, but these errors were encountered: