Hi folks,

I’ve been looking a lot into some of the issues we have found with MP 
integration in Plus and Plumed
https://jira.apache.org/jira/browse/TOMEE-2408 
<https://jira.apache.org/jira/browse/TOMEE-2408>

I came up with a specific TomEE extension to run before any other MP stuff to 
try to add some rules that will allow to enable / disable MP services. Here is 
a skeleton implementation:
https://github.com/apache/tomee/pull/304 
<https://github.com/apache/tomee/pull/304>

One of the issues is that Health, Metrics and OpenAPI expose REST endpoints. 
These are scanned and added to the web apps before any CDI scanning takes 
place, so we need to do a trick to access the Web App deployment and remove the 
endpoints if they are not needed (when there are not other REST endpoints 
available or no MP specific features are being used).

Another case, is some MP feature can be deployed only with interceptors without 
any additional REST endpoints (except the default ones) and we need to figure 
those cases as well. For what I can tell, I was not able to find any CDI API 
that allows us to get that information easily, so we may need to check each 
interceptor annotation on CDI scanning.

I’m not completely sure if this is the right direction, so I would like to have 
some feedback on this.

I’ll probably propose to have a more pragmatic approach regarding Plus and 
Plume. Just add a configuration to enable / disable MP scanning completely. 
This will be off by default, and you have to change a setting to turn it on. I 
think we still need to be more smart about the deployment and have the server 
figure out when its needed or not. On the other hand, I also think with a 
configuration it will be safer for existing environment, so we don’t break 
someone else deployment with a scenario that we didn’t foresee.

Any thoughts?

Cheers,
Roberto

Reply via email to