You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Timothy James Ward (Jira)" <ji...@apache.org> on 2021/06/08 11:08:00 UTC

[jira] [Commented] (CXF-8544) SseEventSink cannot be used in a @POST resource method

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

Timothy James Ward commented on CXF-8544:
-----------------------------------------

Hi - I have been able to create a relatively simple failing test demonstrating the problem, and I have submitted it [as a PR|https://github.com/apache/cxf/pull/812]. I've had to parse the event stream by hand in the test as the JAX-RS SSE client doesn't permit POST requests.

If the test is changed to use a get request (with the necessary HTTP Header set) then it passes, but the POST fails, with the response closing after the string "event:" has been sent.

> SseEventSink cannot be used in a @POST resource method
> ------------------------------------------------------
>
>                 Key: CXF-8544
>                 URL: https://issues.apache.org/jira/browse/CXF-8544
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.2.14
>            Reporter: Timothy James Ward
>            Assignee: Andriy Redko
>            Priority: Major
>
> It is possible (and legal according to the JAX-RS specification) to inject a SseEventSink into a resource method annotated with @POST. This works, but the Server Sent Event stream gets automatically closed after the first event is sent. This prevents any @POST resource method from sending Server Sent Events using the API.



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