Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Request-Response Only? #50

Open
brentarias opened this issue Mar 25, 2016 · 1 comment
Open

Request-Response Only? #50

brentarias opened this issue Mar 25, 2016 · 1 comment

Comments

@brentarias
Copy link

I have the impression that SwaggerSocket only supports a correlated request-response model. In other words, SwaggerSocket does not support POST requests being pushed from the server. Correct? Could that feature be added?

I bring this up because I'm thinking about the webhook paradigm. A webhook is usually a POST request. If I were to convert an existing webhook enabled application to use SwaggerSocket, I'd want SwaggerSocket to support a subscription model, where POST requests are arbitrarily sent to the client.

@elakito
Copy link
Collaborator

elakito commented Apr 6, 2016

@brentarias
sorry for the delay.

If your jaxrs resource is holding on to the output stream (over StreamingOutput or HttpServletResponse), you can push data asynchronously over that stream. There is a sample in cxf's samples that uses this approach to return a series of server events.

https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/websocket/src/main/java/demo/jaxrs/server/CustomerService.java

see the operations sitting at /monitor and /monitor2.

regards, aki

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants