Is it feasible to piggy-back onto Model Server's Jetty (Javalin) instance? #83
-
This probably belongs in the modelserver channel. Let me know if I'm breaking the rules. As part of implementing a solution somewhat like the coffee editor, I have a requirement to implement a custom web service to be accessed from the frontend. My choice would be use Javalin, backed up by Jetty, to implement this. Since I'm also using the Model Server, this would result in two different Javalin/Jetty instances on the same server, which seems somewhat wasteful. In fact, my new web service also needs access to the Model Server. So, my question is if it is feasible to somehow put these two processes together in a single Jetty instance, which is really more of a question of if it is possible in the Model Server implementation to separate out and generalize the Jetty (Javalin) piece, even if it means some code tweaking of the Model Server on my part. TIA. original thread by GaryKopp |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
While it is possible to run multiple jetty instances listening to different ports, I'd think the best approach -- especially when your services need to access the modelserver anyway -- is to extend the modelserver's javalin instance with additional endpoints. |
Beta Was this translation helpful? Give feedback.
-
[GaryKopp] Thank you Philip. That is very helpful. |
Beta Was this translation helpful? Give feedback.
While it is possible to run multiple jetty instances listening to different ports, I'd think the best approach -- especially when your services need to access the modelserver anyway -- is to extend the modelserver's javalin instance with additional endpoints.
An example for this is linked below. This example is likely based on a newer version of the modelserver than is used in the coffee editor, but here additional routings are registered:
https://github.com/eclipsesource/uml-glsp/blob/23172c4c1a4365bcf53946025c8c08367a2e597c/server/com.eclipsesource.uml.modelserver/src/main/java/com/eclipsesource/uml/modelserver/UmlModelServerModule.java#L80
https://github.com/eclipsesource/uml-glsp/blob…