[
https://issues.apache.org/jira/browse/KAFKA-14247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Philip Nee updated KAFKA-14247:
-------------------------------
Description:
The background thread runs inside of the DefaultEventHandler to consume events
from the ApplicationEventQueue and produce events to the BackgroundEventQueue.
The background thread runnable consist of a loop that tries to poll events from
the ApplicationQueue, processes the event if there are any, and poll
networkClient.
In this implementation, the DefaultEventHandler spawns a thread that runs the
BackgroundThreadRunnable. The runnable, as of the current PR, does the
following things:
# Initialize the networkClient
# Poll ApplicationEvent from the queue if there's any
# process the event
# poll the networkClient
PR: [https://github.com/apache/kafka/pull/12663]
was:
The polling thread uses events to communicate with the background thread. The
events send to the background thread are the {_}Requests{_}, and the events
send from the background thread to the polling thread are the {_}Responses{_}.
Here we have an EventHandler interface and DefaultEventHandler implementation.
The implementation uses two blocking queues to send events both ways. The two
methods, add and poll allows the client, i.e., the polling thread, to retrieve
and add events to the handler.
PR: https://github.com/apache/kafka/pull/12663
> Implement EventHandler interface and DefaultEventHandler
> --------------------------------------------------------
>
> Key: KAFKA-14247
> URL: https://issues.apache.org/jira/browse/KAFKA-14247
> Project: Kafka
> Issue Type: Sub-task
> Components: consumer
> Reporter: Philip Nee
> Assignee: Philip Nee
> Priority: Major
>
> The background thread runs inside of the DefaultEventHandler to consume
> events from the ApplicationEventQueue and produce events to the
> BackgroundEventQueue.
> The background thread runnable consist of a loop that tries to poll events
> from the ApplicationQueue, processes the event if there are any, and poll
> networkClient.
> In this implementation, the DefaultEventHandler spawns a thread that runs the
> BackgroundThreadRunnable. The runnable, as of the current PR, does the
> following things:
> # Initialize the networkClient
> # Poll ApplicationEvent from the queue if there's any
> # process the event
> # poll the networkClient
> PR: [https://github.com/apache/kafka/pull/12663]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)