Skip to content
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

Customizable thread names for JolokiaServer/JolokiaServerConfig #367

Closed
mjustin opened this issue Jan 6, 2018 · 6 comments
Closed

Customizable thread names for JolokiaServer/JolokiaServerConfig #367

mjustin opened this issue Jan 6, 2018 · 6 comments

Comments

@mjustin
Copy link

mjustin commented Jan 6, 2018

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:

@rhuss
Copy link
Member

rhuss commented Jan 10, 2018

Sound like a very good idea. Fancy for doing a PR ? (i'm a bit loaded these days)

@mjustin
Copy link
Author

mjustin commented Jan 12, 2018

If I do just one of those options, I'm thinking "threadNamePrefix" as it's the most straightforward to implement. Sound reasonable?

@rhuss
Copy link
Member

rhuss commented Jan 13, 2018

"threadNamePrefix" sounds fine to me.

@mjustin
Copy link
Author

mjustin commented Mar 19, 2018

I have since switched to a different project that does not use Jolokia. It will therefore be unlikely that I will find the time to make this improvement in the near future.

nevenr added a commit to nevenr/jolokia that referenced this issue Jun 30, 2018
nevenr added a commit to nevenr/jolokia that referenced this issue Jul 1, 2018
nevenr added a commit to nevenr/jolokia that referenced this issue Jul 2, 2018
rhuss added a commit that referenced this issue Jul 5, 2018
…Server-367

Customizable thread names for JolokiaServer/JolokiaServerConfig #367
@mjustin
Copy link
Author

mjustin commented May 13, 2020

@rhuss — Looks like this was implemented back in 2018 and thus can be closed, correct?

@rhuss
Copy link
Member

rhuss commented May 13, 2020

yep. thanks for the heads up, stay safe ...

@rhuss rhuss closed this as completed May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants