You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, ParallelConsumerOptions class offers the ability to pass a JNDI name for custom implementations for the Thread executor service and thread factory (managedExecutorService and managedThreadFactory respectively). Java 21 offers Virtual threads that can be used in this scenario to achieve better performance and low resource usage.
To provide a different executor and thread factory using JNDI registration is not "developer friendly" today. It requires more knowledge about how JNDI works and how to register the custom objects for InitialContext lookup.
Workaround (how to make it work today)
Today, the current method to use Virtual Threads is the following.
Create a custom JNDI Context Factory using a custom InitialContext class:
The text was updated successfully, but these errors were encountered:
dougcavalheiro
changed the title
Accept instance params for managedExecutorService and managedThreadFactory to avoid JNDI implementation
Accept instance params for managedExecutorService and managedThreadFactory as an alternative to JNDI implementation
Apr 4, 2025
Context
Currently,
ParallelConsumerOptions
class offers the ability to pass a JNDI name for custom implementations for the Thread executor service and thread factory (managedExecutorService
andmanagedThreadFactory
respectively). Java 21 offers Virtual threads that can be used in this scenario to achieve better performance and low resource usage.Problem
To provide a different executor and thread factory using JNDI registration is not "developer friendly" today. It requires more knowledge about how JNDI works and how to register the custom objects for
InitialContext
lookup.Workaround (how to make it work today)
Today, the current method to use Virtual Threads is the following.
Proposed Solution
Allow the builder (Or the Parallel Stream Processor) to accept the
ExecutorService
andThreadFactory
instances:OR:
The text was updated successfully, but these errors were encountered: