[ 
https://issues.apache.org/jira/browse/FLUME-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13916363#comment-13916363
 ] 

Hari Shreedharan commented on FLUME-2333:
-----------------------------------------

In this case, I am not talking about handlers in terms of servlet handlers, I 
am talking about HTTP Source Handler instances. The problem with the 
HttpResponse going into the HTTP Source Handler and that writing stuff before 
the source calls sendError() is that the data could already have been pushed 
out from the HttpResponse buffer (I believe that this is a buffered stream and 
the response can get pushed out, even without calling flush). I think the Flume 
source should call sendError() anyway, but should also allow the handler to be 
able to send a response. Also, nothing really stops the Source handler from 
calling flush (unless we wrap the response object in a FlumeHttpResponse class 
object that ignores flush calls). 

I am not a web developer, so my knowledge about HTTP servlets is pretty limited.

> HTTP source handler doesn't allow for responses
> -----------------------------------------------
>
>                 Key: FLUME-2333
>                 URL: https://issues.apache.org/jira/browse/FLUME-2333
>             Project: Flume
>          Issue Type: Improvement
>            Reporter: Jeremy Karlson
>            Assignee: Jeremy Karlson
>         Attachments: FLUME-2333.diff
>
>
> Existing HTTP source handlers recieve events via a HTTPServletRequest.  This 
> works, but because the handler doesn't have access to the 
> HTTPServletResponse, there is no ability to return a response.  This makes it 
> unsuitable for some sort of protocol that relies on bidirectional 
> communication.
> My solution: In addition to the existing HTTPSource interface, I've added a 
> BidirectionalHTTPSource interface that is provided the servlet response as a 
> parameter.  I've made some changes in the HTTP source allow for both types to 
> co-exist, and my changes shouldn't affect anyone who is already using the 
> existing interface.
> Also includes minor documentation updates to reflect this.
> Review: https://reviews.apache.org/r/18555/



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to