Open PetrGlad opened 6 years ago
This would also allow to customize the generated threads, e.g. set a flow-ID.
Also, it would allow to not have the threads all named the same (nakadi-java-compute-0
or nakadi-java-io-0
). This makes it really confusing in the logs, if you have several StreamProcessors running in your application.
In my observation "compute" threads are idle at least half of the time so sharing executor service with other parts in the system would help to reduce resource usage. This would help to reduce number of required threads when reading multiple streams. "io" threads seem to busy most of the time waiting on input so in that case shared executor service might be less beneficial but it is still nice to have some means to fine-tune thread factory.
So the suggested improvement is to have means to provide user-defined StreamProcessor#monoIoScheduler, and StreamProcessor#monoComputeScheduler (they won't be necessarily "mono" then :)
A good place for that might be
nakadi.StreamConfiguration
but probably there are better options.