Replies: 1 comment 1 reply
-
Hi @liweinan. Excellent analysis! A couple things I see when looking at this.
In general I've got no opposition to having inside WildFly. However, I see this as more of a debug feature. I don't think using this in production would be advisable as it would impact performance. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently
resteasy-tracing
has two parts:API/SPI
and itsImplementation
. The first part is located insideresteasy
main repository:The second part is in the
resteasy-extension
repository:Currently we already have Galleon Feature Pack for the first part:
With the above Galleon Feature Pack, users can install the modules into WildFly dynamically with
galleon.sh
command line tool.However, merely installing the module won’t enable the Tracing Feature for
WildFly/EAP
, because the Implementation part is not installed intoWildFly/EAP
yet.Currently the loading process of
resteasy-tracing
is located here:As shown in the above code, the
RESTEasyTracingLogger
will try to find a implementation of theRESTEasyTracing
abstract class from currentclasspath
:And the above
org.jboss.resteasy.tracing.api.RESTEasyTracing
abstract class is located in theresteasy-extension
subproject:So the tracing feature loading logic is:
org.jboss.resteasy.tracing.api.RESTEasyTracing
in the classpath(which meansresteasy-extensions
is added into project dependency scope), then the tracing feature will be enabled, otherwise the tracing feature is bypassed.To summarize the above analyze process, here is the class diagram of the tracing feature in
resteasy-extension
:And here is the class diagram of the tracing feature core classes that combining the
resteasy
andresteasy-extension
:In conclusion, if we want to enable the tracing feature inside
WildFly/EAP
, then we need to makeresteasy-extension
as feature pack too, soWildFly/EAP
can use it internally.In addition, if we want to expose the tracing feature from
WildFly/EAP
to the deployed projects, we need to write a processor like*JaxrsSpringProcessor
:If we don’t write a processor like this, then the tracing module can only be used by
WildFly/EAP
by itself.Nevertheless, the deployed project can add
resteasy-extensions
into their own project dependency scope and bundle it themselves. Here is an example using the tracing feature:Tracing Mode
The tracing feature can set it’s working mode at runtime, and there are three modes defined in
ResteasyContextParameters
:The default mode is
OFF
, so the tracing feature won’t output any tracing information, and if we integrate the tracing feature intoWildFly/EAP
, thenWildFly/EAP
can use the mode setting internally to modify the tracing mode. For deployed projects, these parameters can be set runtime too(I need to provide an example how to do this).To summarize the above report, there are several things we need to decide:
WildFly/EAP
as a jboss-module or galleon-feature-pack.WildFly/EAP
for the tracing feature, so the deployed project can use it directly without adding theresteasy-extensions
into their own project dependency scope.WildFly/EAP
use the tracing feature(for example, how should the server set the tracing mode internally).Beta Was this translation helpful? Give feedback.
All reactions