EJB Remote Invocations over REST: Difference between revisions
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 27: | Line 27: | ||
</pre> | </pre> | ||
* The target service must be deployed in such a way that it bootstraps a JAX-RS service endpoint (WAR instead of | * The target service must be deployed in such a way that it bootstraps a JAX-RS service endpoint (WAR instead of EJB JAR) | ||
The code is the first attempt and it is sub-optimal, it can be further improved. |
Latest revision as of 18:45, 2 May 2017
Internal
Overview
EJB calls can routed over REST invocations by changing "@EJB(lookup = "")" into "@Inject" and adding a RestClientProducer as shown in the example linked below.
GitHub Example
Changes from EJB to REST
- The business interfaces of the target services must be annotated with JAX-RS annotations (business method(s) and
association to a @Path). Note that the EJB @Remote annotation may remain on the business interface.
@Remote @Path("/") public interface Callee { @POST @Consumes("application/json") String businessMethodA(String arg); }
- The target service must be deployed in such a way that it bootstraps a JAX-RS service endpoint (WAR instead of EJB JAR)
The code is the first attempt and it is sub-optimal, it can be further improved.