Customizable thread names for JolokiaServer/JolokiaServerConfig #367
It would be useful to be able to configure the thread names of threads created by the Jolokia server. That way if the application is logging thread names, it'll be obvious which threads were from Jolokia server requests. For instance, in my app I might want to have the threads named "jolokia-1", "jolokia-2", ... instead of the Java default "Thread-1", "Thread-2", ...
This could be solved by adding a "threadNamePrefix" or "threadNameFormat" option to the JolokiaServerConfig.
Alternatively, if there was a way to specify the Executor or ThreadFactory used by the the HttpServer, the user could customize it to set whatever name they wanted.
The current workaround to achieve this is to create a JolokiaServer with a manually created HttpServer, rather than letting Jolokia create the server. In addition to the additional code and potential inconsistency of manually configuring an HttpServer, it also means that it cannot be used with jolokia-spring's SpringJolokiaAgent, as that uses the default server created by JolokiaServer.
Example of APIs in other frameworks that have this sort of behavior:
The text was updated successfully, but these errors were encountered: