Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to turn off Transfer-Encoding: Chunked when sending with jetty client

Simone Bordet-3 wrote
> Can you expand on what you mean by "outdated" ?
> You mean that you would prefer a ReactiveStreams API for SSE rather
> than the API that is provided ?
> Are you using
> https://github.com/eclipse/jetty.project/blob/master/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/EventSourceServlet.java
> ?
> 
> Also you said you are sending text/event-stream from the *client* ?

I guess "outdated" was a bit harsh, because the EventSource.Emitter API is
quite piece of an equipment. It only misses minor details like
id/comment/retry and possibility to have better control over flushing, but
those could easily be added to it.

I've patched EventSourceServlet to use javax.servlet.WriteListener to have
control over throttling. The original EventSource API hid the javax.servlet
quite nicely, but I was thinking about using ReactiveStreams adapter to hide
WriteListener. So the Emitter API combined with ReactiveStreams would suit
me well.

I'm also sending text/event-stream and using the Emitter API the other way
around as awful as it may sound. Of course the rest of the RFC itself is
quite meaningless because it revolves around the response, but the content
type is as good as any and http clients DeferredContentProvider works like a
charm with it. Chunking here it merely an annoyance that just makes
alignment of the incoming bytebuffers even more non-optimal for the
ReadListener. ReactiveStreams is a good way to hide the javax.servlet again
and I'm even using the Emitter API to receive data.



--
View this message in context: http://jetty.4.x6.nabble.com/How-to-turn-off-Transfer-Encoding-Chunked-when-sending-with-jetty-client-tp4964913p4964945.html
Sent from the Jetty User mailing list archive at Nabble.com.


Back to the top