-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow configurability of the middleware used by the HttpEventCollectorSender #260
Conversation
Thread.currentThread().getContextClassLoader().loadClass(config.middleware.get()) | ||
.asSubclass(HttpSenderMiddleware.class) | ||
.getDeclaredConstructor() | ||
.newInstance()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am bit sceptical this is gonna work with native compilation : The new instance of the middleware is done by reflection which is not supported by native image without the proper metadata: native image need to known all classes used at runtime otherwise it tries to remove every class definition not used int the final executable.
So we need to instrument the extension to retain the class definition, for that we need to produce a ReflectiveClassBuildItem from the LoggingSplunkProcessor: this might require a build time config which makes sense because the middleware is known at build time.
I would also provide a test in the integration-test
package: we are performing native compilation there to test the extension.
I was more thinking that the class to be used has to be annotated with Do you suggest to use something like |
Yes it's a solution.
I had the feeling that even the name of the middleware is known at build time, can you explain why it would be a runtime configuration?
It could be a solution if we agree on point 2 |
In our CI/CD we aim at deploying same built version in every environment. Then step by step activate a change in one environment, then the other up to production. |
Fair enough, so let's try the solution proposed above |
Fine for me. |
A user application can utilize HttpEventCollectorMiddleware to customize the behavior of sending events to Splunk.
This can be configured by using the "middleware" configuration key