Provide Camunda REST API on Jetty
tobiasschaefer opened this issue · 4 comments
It must be possible to activate the REST API of Camunda.
Todo: find out how to do this. It might be difficult because this is a servlet, see also micronaut-projects/micronaut-core#1004 for similar issue regarding the h2-console.
- configurable (camunda.bpm.webapp.enabled), default on if no impact to startup time - probably for REST and the three Webapps
- default path: /engine-rest, see also https://docs.camunda.org/manual/latest/user-guide/spring-boot-integration/rest-api/
- document this in README (including list of features)
- Authentication should be configurable.
- Tests on all servers (Jetty, Tomcat, Undertow, Netty) and document if not supported
- Check again and document: https://micronaut-projects.github.io/micronaut-jaxrs/latest/guide/index.html vs Jersey
- (should not increase startup time)
- (no warnings on startup)
This will probably help: https://github.com/micronaut-projects/micronaut-servlet
Just some comments:
- it would be good if the webapps would be accessible on the same port as the main application. If needed, we could implement a proxy to forward the requests to a second server (probably running on Jetty).
- the application developer decides which server (Netty, Jetty, Undertow) is used. We should not force the usage of a specfic server.
- it should be possible to configure which web apps are deployed. We need to decide on a default.
- if you need help: https://gitter.im/micronautfw/questions
So the REST-API is an artifact of it's own and can be embedded in any other JAX-RS (Java API fo RESTful Webservices) application. According to the docs it is tested with Resteasy, Jersey and Wink. (See https://docs.camunda.org/manual/latest/reference/rest/overview/embeddability/)
Since Micronaut does not offer a JAX-RS implementation I used Jersey (2). (See https://micronaut-projects.github.io/micronaut-jaxrs/latest/guide/index.html, "This project is not an implementation of the JAX-RS specification and is designed to allow users familiar with the JAX-RS API to use the most common parts of the API within the context of a Micronaut application.")
REST API works and is tested on
- Netty
- Jetty with Micronaut Servlet
- Undertow (should work with Micronaut Servlet)
- Tomcat (should work with Micronaut Servlet)
Impact on Startup time
- Jetty: Impact on startup after adding the rest api(on my maschine) is around 400ms.
NETTY
So far it was only possible to host the rest api on a different port.
See: https://github.com/martisaw/micronaut-camunda-bpm/tree/netty
Tomcat
I added the MnServlet Tomcat Dependency and general Tomcat Dependency but I am not able to start. It seems that something is still missing, but I have no idea how.
- Figure out which dependies are missing
Undertow
tbd.
JETTY
I used Jersey in combination with MicronautServlet and added the rest api as a sevlet.