[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-04-15 Thread Markus Rathgeb (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17084239#comment-17084239
 ] 

Markus Rathgeb commented on ARIES-1968:
---

I cloned the Aires JAX-RS Whiteboard repository and build the current master.

After that I run the test again and all looks good to me.

So, for me this issue has been resolved by using the latest CXF release.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-04-05 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17075882#comment-17075882
 ] 

ASF subversion and git services commented on ARIES-1968:


Commit 14b8acaf0d70069813ee7ffd1f9d9943305385d6 in aries-jax-rs-whiteboard's 
branch refs/heads/master from Raymond Auge
[ https://gitbox.apache.org/repos/asf?p=aries-jax-rs-whiteboard.git;h=14b8aca ]

[ARIES-1968] use released version

Signed-off-by: Raymond Auge 


> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-04-04 Thread Markus Rathgeb (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17075729#comment-17075729
 ] 

Markus Rathgeb commented on ARIES-1968:
---

I just want to add myself to the release notifications of CXF using GitHub...

If GitHub does not lie to me CXF 3.2.13 has been released 12 days ago.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-04-04 Thread Jira


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17075175#comment-17075175
 ] 

Carlos Sierra Andrés commented on ARIES-1968:
-

hey [~maggu2810] ,

yes... as far as I know releases can't depend on snapshots. Did you try the 
whiteboard snapshot? did it work for you?

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-04-03 Thread Markus Rathgeb (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17074815#comment-17074815
 ] 

Markus Rathgeb commented on ARIES-1968:
---

I assume we need to wait for a CXF release before we can expect a new 
whiteboard release. Correct?

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-03-23 Thread Jira


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17064744#comment-17064744
 ] 

Carlos Sierra Andrés commented on ARIES-1968:
-

hey [~maggu2810] , done

you should get the 1.0.9-SNAPSHOT of the whiteboard which includes latest CXF 
3.2.13-SNAPSHOT

Bests.

Carlos.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-03-23 Thread Jira


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17064729#comment-17064729
 ] 

Carlos Sierra Andrés commented on ARIES-1968:
-

hey [~maggu2810],

yes... I reverted it to release the 1.0.8 version of the whiteboard (which 
upgraded CXF to version 3.2.12) which fixed several CVE's. I can readd the 
latest snapshot again and generate a new snapshot of the whiteboard... this 
time it will be 1.0.9-SNAPSHOT

Carlos.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-03-20 Thread Markus Rathgeb (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17063641#comment-17063641
 ] 

Markus Rathgeb commented on ARIES-1968:
---

Hi [~csierra]

I hope you are well.

Do you plan to integrate the fixed CXF (resolved regression) into a new 
whiteboard build?

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-03-11 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17056756#comment-17056756
 ] 

ASF subversion and git services commented on ARIES-1968:


Commit dee3b4dc50a671890e3806f393c58572a4e6fc0e in aries-jax-rs-whiteboard's 
branch refs/heads/master from Carlos Sierra Andrés
[ https://gitbox.apache.org/repos/asf?p=aries-jax-rs-whiteboard.git;h=dee3b4d ]

Revert "[ARIES-1968] Use latest CXF"

This reverts commit e4d2deecb0b8cf7182994dc84c5e4c643971cf14.


> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by 

[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-03-03 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17050399#comment-17050399
 ] 

ASF subversion and git services commented on ARIES-1968:


Commit e4d2deecb0b8cf7182994dc84c5e4c643971cf14 in aries-jax-rs-whiteboard's 
branch refs/heads/master from Carlos Sierra Andrés
[ https://gitbox.apache.org/repos/asf?p=aries-jax-rs-whiteboard.git;h=e4d2dee ]

[ARIES-1968] Use latest CXF


> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-02-14 Thread Markus Rathgeb (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17037141#comment-17037141
 ] 

Markus Rathgeb commented on ARIES-1968:
---

Hi [~csierra],
 I do not have any additional input.

Did you find some time to test the code I added above? Did it work for you or 
can you confirm my observation?

I opened an additional issue for CXF 
(https://issues.apache.org/jira/browse/CXF-8215).

I hope that the problem will not be rejected because it relies on an OSGi 
component that is not part of CXF.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message 

[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-02-12 Thread Jira


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17035143#comment-17035143
 ] 

Carlos Sierra Andrés commented on ARIES-1968:
-

Hi [~maggu2810],

do you have any more input for this issue?

just let us know if you open an issue to CXF (or if you would like us to do it) 
to link it here.

I would say it should be you since you did all the research.

Bests.

Carlos.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that allow the cross-origin access are 
> added.
> This needs to be added to the initial header (first response) of the SSE 
> connection, too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-02-01 Thread Jira


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17028219#comment-17028219
 ] 

Carlos Sierra Andrés commented on ARIES-1968:
-

Hi [~maggu2810],

sorry if something I said made you be irritated. It was never my intention. 
Please take into account that english is not my mother tonge.

So let me rephrase: I am not sure if our test is correct or not. I was just 
pointing you to our test since it is describing how it is working. If you think 
that the behavior described by the test is not correct then we need to open a 
bug to CXF since it is the system providing that feature.

Sorry again if I said something that upset you.

Carlos.

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE reponse I 
> would expect "simple response filter" is shown once, too.
>  
> In my application there is a ContainerResponseFilter to allow (configurable) 
> CORS. If it is enabled, the headers that 

[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-01-31 Thread Markus Rathgeb (Jira)


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17027639#comment-17027639
 ] 

Markus Rathgeb commented on ARIES-1968:
---

Hi Carlon,

I am a little bit irritated.

If your test case succeed (the aotmic integer that tracks the 
ContainerResponseFilter call is increased twice) and my test case (not yet an 
automatic one) fails, then I assume that one of the both test cases is not 
correct. If yours is working, then I don't need to create an issue for CXF but 
need to find the issue in my code base.

If my code base is correct, then we -need- could try to detect the error in 
your test code first.

If there is an test case that runs without user interaction that shows the 
error (if there is any) then we could give CXF a better mechanism to reproduce 
it...

I will now read ARIES-1867 and check what is already answered.

Thank you

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE 

[jira] [Commented] (ARIES-1968) SSE breaks Pipeline Processing

2020-01-27 Thread Jira


[ 
https://issues.apache.org/jira/browse/ARIES-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17024398#comment-17024398
 ] 

Carlos Sierra Andrés commented on ARIES-1968:
-

Hi [~maggu2810], 

thx for reporting this. I believe the whiteboard relies completely on CXF for 
this, so this bug report should be filed to CXF. 

We already had a test for this behaviour, but according to your description the 
test is wrong and should be failing: 
[https://github.com/apache/aries-jax-rs-whiteboard/blob/f0417bac76884602f9b1d0607cfe7313011e468e/jax-rs.itests/src/main/java/test/JaxrsTest.java#L2571]

we already discussed this here:https://issues.apache.org/jira/browse/ARIES-1867

so I guess we should open this ticket to CXF then?

Would you mind doing that [~maggu2810] since you made the research?

btw... I tried CXF 3.2.12 version and it seems to behave in the same way.

Carlos.

 

> SSE breaks Pipeline Processing
> --
>
> Key: ARIES-1968
> URL: https://issues.apache.org/jira/browse/ARIES-1968
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.5, jax-rs-whiteboard-1.0.7, 
> jax-rs-whiteboard-1.0.6
>Reporter: Markus Rathgeb
>Priority: Major
>
> The JAX-RS Specification 2.1 contains the chapter 9 for "Server-Sent Events".
> The chapter 9.5 "Pipeline Processing" declares:
> {quote}For compatibility purposes, implementations MUST initiate processing 
> of an SSE response when either the first message is sent or when the resource 
> method returns, whichever happens first. The initial SSE response, which may 
> only include the HTTP headers, is processed using the standard JAX-RS 
> pipeline as described in Appendix C. Each subsequent SSE event may include a 
> different payload and thus require the use of a specific message body writer. 
> Note that since this use case differs slightly from the normal JAX-RS 
> pipeline, implementations SHOULD NOT call entity interceptors on each 
> individual event (1).
> {quote}
> So, the initial SSE response is processes using the standard JAX-RS pipeline 
> (Appendix C).
> Appendix C indicates that in front of the method invocation the "Container 
> Request Chain" is handled and after the method invocation the "Container 
> Response Chain" is handled.
>  
> The container response chain is currently not handled for the first response!
> It is also not handled for the other reponses, but this is expected.
>  
> I checked v1.0.5, v1.0.6 and v1.0.7 all seems to be broken for me.
>  
> h2. Test code:
>  
> {code:java}
> @Component(service = Application.class)
> @JaxrsName("rest")
> @JaxrsApplicationBase("rest")
> public class RESTApplicationImpl extends Application {
> }{code}
>  
>  
> {code:java}
> @Component(service = { RESTResource.class })
> @JaxrsResource
> @JaxrsName("foo")
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> @Path("/foo")
> public class RESTResource {
> @GET
>  @Path("normal")
>  public Response normal() {
>  System.out.println("handle endpoint \"normal\"");
>  return Response.ok().build();
>  }
> @GET
>  @Path("sse")
>  @Produces(MediaType.SERVER_SENT_EVENTS)
>  public void sse(@Context final SseEventSink eventSink, @Context final Sse 
> sse) {
>  System.out.println("handle endpoint \"sse\"");
>  final ExecutorService executor = Executors.newSingleThreadExecutor();
>  executor.execute(() -> {
>  try (SseEventSink sink = eventSink) {
>  eventSink.send(sse.newEvent("event1"));
>  eventSink.send(sse.newEvent("event2"));
>  }
>  });
>  executor.shutdown();
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleRequestFilter implements ContainerRequestFilter {
> @Override
>  public void filter(final ContainerRequestContext context) {
>  System.out.println("simple request filter");
>  }
> }
> {code}
>  
>  
> {code:java}
> @Component
> @JaxrsExtension
> @JaxrsApplicationSelect("(" + JaxrsWhiteboardConstants.JAX_RS_NAME + "=rest)")
> public class SimpleResponseFilter implements ContainerResponseFilter {
> @Override
>  public void filter(final ContainerRequestContext requestContext, final 
> ContainerResponseContext responseContext)
>  throws IOException {
>  System.out.println("simple response filter");
>  }
> }
> {code}
>  
>  
> h2. Test:
> On a GET request to "http://127.0.0.1:8080/rest/foo/normal; is see (on the 
> server console):
>  
> {noformat}
> simple request filter
> handle endpoint "normal"
> simple response filter{noformat}
>  
> On a GET request to "http://127.0.0.1:8080/rest/foo/sse; is see (on the 
> server console): 
> {noformat}
> simple request filter
> handle endpoint "sse"{noformat}
>  
> As the normal processing pipeline must be applied for the first SSE