Serving as both an example of how to author a Disco library/plugin, and also as a usable Event producer for popular frameworks used in service oriented software, this subproject is layed out as follows:
- In this folder, the Installables to intercept Servlet and Apache Client interactions, and issue appropriate Event Bus Events.
- In the disco-java-agent-web-plugin subfolder, a proper Disco plugin, bundled as a plugin JAR file with Manifest.
Feature | Status | Event generated |
---|---|---|
Servlet requests | ✔️ | HttpServletNetworkRequestEvent |
Servlet response | ✔️ | HttpServletNetworkResponseEvent |
Apache Client request | ✔️ | HttpServiceDownstreamRequestEvent |
Apache Client response | ✔️ | HttpServiceDownstreamResponseEvent |
Apache Async Client request | ✖️ | N/A |
Apache Async Client response | ✖️ | N/A |
Event | Feature | Status |
---|---|---|
HttpServiceDownstreamRequestEvent | Header insertion | ✔️ |
WebSupport.java implements the Package interface, and is a way for a standalone agent to gather all the Installables that the library defines, without having to know the quantity of them, or their particular class names.
Disco supports two models of development:
- Standalone, self-contained agents.
- Pluggable, extensible agents.
If you only want to support the first of these, there's no need to produce the plugin MANIFEST or to shade/shadow your JAR file. The final build of the Agent itself would do that all in a single step.
On the other hand, if you only wanted to support the Plugin model you could simply have all your source code and your MANIFEST or MANIFEST-generation in a single project.
For the purposes of this library, especially since it serves as an example, we support both mechanisms, hence the factoring into a lib project and a plugin JAR project.
You can see tests for both 'flavours' in the disco-java-agent-example-test project. Inside the build.gradle.kts file there are two test targets
- The familiar default 'test' target, which tests via the standalone disco-java-agent-example agent
- An extra 'testViaPlugin' test target, which tests using the disco-java-agent canonical agent, and the built disco-java-agent-web-plugin plugin.