[
https://issues.apache.org/jira/browse/KAFKA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418049#comment-13418049
]
Jay Kreps commented on KAFKA-398:
---------------------------------
I meant this:
+ // Here we have to hack the socket server a little bit since the request
+ // does not have the key information for the coordinator to store the map
+ //
+ // In 0.8 socket server this is unnecessary since the key info is included
+ // in the request
+ var start: Long = -1
+ var maybeSend: Option[Send] = null
+ if (RequestKeys.isCoordinatorRequest(requestTypeId)) {
+ val handler = handlerMapping.coordinatorHandleFor(requestTypeId, request)
+ if(handler == null)
+ throw new InvalidRequestException("No handler found for request")
+ start = time.nanoseconds
+ maybeSend = handler(request, this, key)
+ }
+ else {
+ val handler = handlerMapping.handlerFor(requestTypeId, request)
+ if(handler == null)
+ throw new InvalidRequestException("No handler found for request")
+ start = time.nanoseconds
+ maybeSend = handler(request)
+ }
+
> Enhance SocketServer to Enable Sending Requests
> -----------------------------------------------
>
> Key: KAFKA-398
> URL: https://issues.apache.org/jira/browse/KAFKA-398
> Project: Kafka
> Issue Type: Improvement
> Components: core
> Affects Versions: 0.7, 0.8
> Reporter: Guozhang Wang
> Labels: features
> Attachments: kafka-398-0.7-v1.patch, kafka-398-0.7-v2.patch
>
>
> Currently the SocketServer is only used for reactively receiving requests and
> send responses but not used for pro-actively send requests and receive
> responses. Hence it does not need to remember which channel/key correspond to
> which consumer.
> On the other hand, there are cases such as consumer coordinator that needs
> SocketServer to send requests and receive responses to the consumers.
> It would be nice to add this functionality such that an API can be called
> with the id string and the request message, and the SocketServer will figure
> out which channel to use and write that message to the key's attachment and
> set the flag as WRITABLE so that the processor can then send it.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira