FW: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)
toggle quoted messageShow quoted text
I know this is really late to discuss, but in fact, I doubt that it was a good decision to take WriterInterceptor out of the processing chain for SSE events.
In fact, today I set up a demo app and needed this, so I actually thought that this is a Jersey bug…!
Is there any good technical reason that made us strip WriterInterceptor from the processing chain (see below commit)?
Scenario where this is a problem: I wanted to add support for Optional<T> to demonstrate Java 8 support of JAX-RS. So I set up a WriterInterceptor which simply unwraps Optional to produce T, so all existing pre-2.1 EntityWriters for T will still work. Great. But fails with SSE! Hence, one must rewrite all WriterIntercepors if support for Optional<T> is needed with SSE. Very bad thing!
Why don't we use WriterInterceptors with SSE events?
From: Pavel Bucek [mailto:notifications@...]
Sent: Montag, 26. Juni 2017 09:38
Cc: Markus KARG; Author
Subject: Re: [jersey/jersey] SseEventSink invokes custom WriterInterceptor with wrong type, then throws NPE (#3592)
Please see this: jax-rs/spec@b4b0d91