[
https://issues.apache.org/jira/browse/CXF-8544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17352871#comment-17352871
]
Andriy Redko commented on CXF-8544:
-----------------------------------
[~timothyjward] the JAX-RS follows the Server-Sent Events specification [1],
which indeed does not explicitly mention what HTTP method should be used on the
server side and on client side as well [2]. Nonetheless, as of today the
{{EventSource}} / {{SseEventSource}} uses GET and does not provide the way to
alter the HTTP method, so the server matches these expectations. With that
being said, there should be no technical obstacles in supporting POST as far as
{{EventSource}} / {{SseEventSource}} are not in use. In turn, you could just
fallback to streaming response instead, why do you need SSE? (as a side node,
CXF also supports Websockets [3]).
[1] [https://html.spec.whatwg.org/#server-sent-events
][2]
[https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface]
[3] https://cxf.apache.org/docs/websocket.html
> 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
> 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)