Reputation: 5952
Most of samples of Jax-rs 2 show how to make a request from a client to the jax-rs application. The client can be a HttpClient, RESTEasy or jax-rs client. I want to know how jax-rs application can call its clients without client first call to the server.? It is something like pushing into the clients. I tried to find over the I'net this, but no supportive source found.
Upvotes: 0
Views: 111
Reputation: 1171
Simple answer is that it is not possible. JAX-RS is working on HTTP transport, which is based on the request-response paradigm. So the client needs to first initiate the connection, then server may send the response to him.
If you want to have two systems which can call each other, then you must implement the services and the clients in both of them:
System 1 System 2
Client 1 ------> Service 2
Service 1 <------ Client 2
Upvotes: 2