Custom thread pool for Java 8 parallel stream

It seems that it is not possible to specify thread pool for Java 8 parallel stream. If that's so, the whole functionality is useless in most of the situations. The only situation I can safely use it is a small single threaded application written by one person.
In all other cases, if I can not specify the thread pool, I have to share the default pool with other parts of the application. If someone submits a task that takes a lot of time, my tasks will get stuck. Is that correct or am I overlooking something?
Imagine that someone submits slow networking operation to the fork-join pool. It's not a good idea, but it's so tempting that it will be happening. In such case, all CPU intensive tasks executed on parallel streams will wait for the networking task to finish. There is nothing you can do to defend your part of the application against such situations. Is that so?

You are absolutely correct. That isn't the only problem with using the F/J framework as the parallel engine for bulk operations. Have a look http://coopsoft.com/ar/Calamity2Article.html

Similar Messages

  • [svn] 1605: Bug: BLZ-155 - Deadlock using a thread pool for tomcat connectors

    Revision: 1605
    Author: [email protected]
    Date: 2008-05-07 14:24:53 -0700 (Wed, 07 May 2008)
    Log Message:
    Bug: BLZ-155 - Deadlock using a thread pool for tomcat connectors
    QA: Yes - Jorge verified in the QE lab
    Doc: No
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-155
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/client/EndpointPushNotifier.j ava

    Cross post: http://forum.java.sun.com/thread.jspa?threadID=5215686&tstart=0
    If you must post across forums, just post in the most relevant one and then give the link to that in the other posts.

  • Configuration of Thread Pool for CQ's Web Container

    I am trying to detrmine whether there is any specific configuration for tuning the web container thread pool for CQ. The only configuration I observe is OSGi 's Apache Sling Event Thread Pool but tuning this does not directly correlate to the thread pool that is used for serving web requests by the publish instance.
    Any help would be greatly appreciated as I work through tuning our CQ instance.

    Unfortunately, the max thread settings is not exposed in CQ 5.5.However, all the other configurable settings (equivalent for server.xml) can be seen at [1]
    [1] http://localhost:4502/system/console/configMgr/org.apache.felix.http
    This is fixed in CQ 5.6 current release.
    Thanks,
    Varun

  • Thread pools for execute queues

    We've set up thread pools for several execute queues dedicated to high-load servlets
    in our application. Once in a while, we get into a condition in which none of
    these threads are available and then the threads never become available - we have
    to restart the server.
    I realize that this is a pretty generic description of the problem :-) but I wonder
    if anyone else has encountered this and has an idea what might be causing it ?
    Right now I am guessing that something in our code causes a resource contention
    that eventually deadlocks all the threads. But that is just a guess.

    Ethan,
    "Ethan Allen" <[email protected]> wrote in message
    news:3e0220a1$[email protected]..
    Thanks, Dimitri and Slava !
    I will do this and learn a little emore ...FYI, there is a web site dedicated to weblogic documentation -
    http://e-docs.bea.com/
    Pick your server version, go to "Search", type "thread dump".
    Regards,
    Slava Imeshev
    >
    ethan
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ethan,
    For windows press <Ctrl>+<Break> in the server shell window,
    for *nix send kill -3 {server PID}.
    Regards,
    Slava Imeshev
    "Ethan Allen" <[email protected]> wrote in message
    news:3e020fb4$[email protected]..
    Thanks for your reply, Dimitri.
    We have not looked at thread dumps. How may we do this ?
    Ethan
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Did you try looking at thread dumps when this happens ?
    Ethan Allen <[email protected]> wrote:
    We've set up thread pools for several execute queues dedicated to
    high-load
    servlets
    in our application. Once in a while, we get into a condition in
    which
    none of
    these threads are available and then the threads never become
    available
    - we have
    to restart the server.
    I realize that this is a pretty generic description of the problem:-) but I wonder
    if anyone else has encountered this and has an idea what might be
    causing
    it ?
    Right now I am guessing that something in our code causes a
    resource
    contention
    that eventually deadlocks all the threads. But that is just a
    guess.
    >>>>
    Dimitri

  • Creating a custom UUT dialog for the parallel model

    Hello,
    I am attempting to customize the parallel process model in order to (amongst other things) present a different UUT info dialog.  (The default one defined in modelsupport2.dll only presents a single "Serial number" field where I need numerous other ones.)  Because I am not familiar with CVI (and don't have the development tools for it), I was hoping to create an ActiveX DLL in Visual Basic, or a .NET assembly to manage a slightly more complex version of the UUT info dialog...  While I am sure it would be great fun to fumble with all the complexities of this until it shows some semblance of proper functionality I am hoping there may be some resources available online that would demonstrate how one would go about doing this kind of thing.  I've seen LabVIEW code that provides a different UUT dialog, but it was based on the sequential model which circumvents the most complex issues such as synchronizing the dialog with the TestStand threads, etc.  Any pointers would be greatly appreciated.
    Thanks!

    I am just posting this in case anyone else runs into the same sort of requirement.  The attached zip file contains the source for a .NET assembly that is the beginnings of a VB .NET replacement for the parallel UUT dialog of the modelsupport2 DLL.  I don't want to write an epic here, so the general idea is that the parallel model sequence is modified to make calls into this assembly instead of the modelsupport2.dll component.  But you can't just disable the dialog by setting the ShowUUTDlg boolean to false - that will completely remove the consumer loop in the ProcessDialogRequests sequence which the .NET assembly is trying to send requests to.  I've attached the modified ParallelModel.seq in case anyone's interested.
    Note that there are still significant problems with this and it is provided as-is.  In particular, if you attempt to break and step through the parallel model sequence after the dialog has been initialized, you will not be able to continue - the main thread will hang until you restart TestStand.  With a little more thread mgmt, that could be fixed.  If nothing else, it is useful code to look at if you need to enqueue items from a .NET assembly into a queue defined in a TestStand sequence.
    If you can afford to use the existing dialog as-is, and then add additional info gathering to the main sequence, that is clearly easier.  (That will be OK for my purposes so that is what I'll do.)  However, if you need to have one custom dialog that manages everything in the parallel model, this is the kind of code you should expect to need.
    Hopefully that helps somebody.  There is not much info out there about integrating .NET at this level.
    Attachments:
    CustomUUTDialog.zip ‏117 KB
    ParallelModel.seq ‏430 KB

  • Thread pool for Servlets

              Hi all,
              I am facing a big problem while doing a concurrent testing of my web application.
              I am testing with 60 concurrent users.
              I have set the database connection pool minimum capacity to 50, capacity increment
              to 10 and maximum capacity to 100.
              While there is no problem in getting database connection, the session variables
              are getting mixed up (i.e. the session variable for one user is coming up as that
              for another user!!!).
              Does it have something to do with configuring some pool for servlets threads or
              something?
              Please help.
              Thanks a lot in advance and best regards,
              Jaya
              

              Hi all,
              I am facing a big problem while doing a concurrent testing of my web application.
              I am testing with 60 concurrent users.
              I have set the database connection pool minimum capacity to 50, capacity increment
              to 10 and maximum capacity to 100.
              While there is no problem in getting database connection, the session variables
              are getting mixed up (i.e. the session variable for one user is coming up as that
              for another user!!!).
              Does it have something to do with configuring some pool for servlets threads or
              something?
              Please help.
              Thanks a lot in advance and best regards,
              Jaya
              

  • Servlet Thread Pools for iPlanet WS 4.1

    We have iPlanet WS 4.1 SP 5, running on HP UX. Wanted to make sure servlets run fast, so set up servlet thread pool. Initial result was that even the startup servlet could not be loaded, got stack overflow. Reduced number of threads from 60 to 5. Now startup servlet kicked off OK, but a subsequent servlet processing a request bombed with same error. This is obviously some kind of resource issue; how does one allocate enough memory or whatever it needs to handle the thread pool? Do I really even need a thread pool?

    Thanks, and a follow-up question: at that reference, it seemed to imply there is really no need to allocate a user thread pool if running on Unix. Could even slow down the application. Am I likely to be OK with about 300 concurrent users if I don't allocate a thread pool? I was afraid they'd be single-threaded through the front controller servlet if I did not specifically allocate and use a thread pool, but perhaps multiple threads are already built into the container?

  • Monitoring memory and thread management for Java 1.4.2_04

    Hi,
    I have an application which is using Java version 1.4.2_04. The application deployed in Customer site is having some memory issues. There are observing java.exe going 100% in Task Manager. The same application (of higher version)
    uses Java 1.5 is not seeing any issues.
    Now Customer needs the root cause of the issue and i would like to check the code which is causing the issue. I came to know we can monitor threads and memory using JConsole. Since we are using Java 1.4, i installed Java 1.6 on a remote machine and tried connecting to the problematic machine. But it failed to connect.
    i have added the option "-Dcom.sun.management.jmxremote.port=8880" when starting JVM (this i have provided inside ServletExec batch file, ServletExec is my web server).
    Any idea how to connect to the problematic machine from remote using JConsole. Or any other tools i can use on Java 1.4 to nail down the problem..
    Please provide pointers.
    I have another doubt on Java version 1.4, since there were many memory issues, am i hitting any defect in Java 1.4

    hari.r wrote:
    Please provide pointers.You need to tell you sales/marketing/business requirements people that they must come up with an end of life policy for customers on older versions.
    Unless your company has a service contract with Sun you right now, can no longer insure that the VM will remain secure nor even really running.
    See the following for the java VMs that you are using.
    [http://java.sun.com/products/archive/eol.policy.html]

  • Restricting Thread Pool for Servlet instances

    I am using WebLogic5.1.0 version wherein I am registering a Servlet which
    would be called by all the clients connecting
    to my aplication. The servlet's service methods is taking some time to
    execute. Since the servlet is following a SingleThreadModel, when there are
    a large number of Clients connected, the number instances of Servlets
    created are very high and the number of thread in the Application Server
    process becomes very high affecting the performance of the other
    applications.
    Is it possible to restrict the number of instances of the servlets that get
    created in the Application server ?
    What are the setting required to achieve this ?
    Sandeep

    Hi.
    I'm not aware of a property setting that allows you to restrict the number of
    servlet instances in WLS for the SingleThreadModel. The number of execute
    threads is fixed - it does not grow depending on load. You can set this value
    in the weblogic.properties file by setting weblogic.system.executeThreadCount.
    This value is 15 by default.
    It does sound like you are reaching the max capability of your
    server/hardware. You should try tuning WLS.
    Here are a couple of suggestions:
    1. Try adjusting the executeThreadCount value to a higher value. Start by
    setting it to 30 - see if that makes any difference.
    2. Check out the following tuning guide:
    http://www.weblogic.com/docs51/admindocs/tuning.html
    3. Here is a list of admin properties that might aid in tuning:
    http://www.weblogic.com/docs51/adminhelp/AdminPropertyHelp.html
    4. If you are still having problems you might do better by posting this issue
    to the performance newsgroup.
    Regards,
    Michael
    Sandeep Rajpathak wrote:
    I am using WebLogic5.1.0 version wherein I am registering a Servlet which
    would be called by all the clients connecting
    to my aplication. The servlet's service methods is taking some time to
    execute. Since the servlet is following a SingleThreadModel, when there are
    a large number of Clients connected, the number instances of Servlets
    created are very high and the number of thread in the Application Server
    process becomes very high affecting the performance of the other
    applications.
    Is it possible to restrict the number of instances of the servlets that get
    created in the Application server ?
    What are the setting required to achieve this ?
    Sandeep--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Cold Fusion in a generic thread pool and enabling JAVA don't mix

    I've got Cold Fusion MX installed on a server running Sun One 6.1. I ran into a problem trying to enable JAVA (for servlet support) which I had previous disabled because I didn't use it.
    Well, when I went to enable JAVA on the server last week, the service wouldn't restart and the error logs gave me no indication of the problem.
    Through a tedious trial-and-error process I've found that having Cold Fusion running under a generic thread pool while trying to have JAVA (the j2ee plugin) running under Sun One simply doesn't work (for whatever reason).
    Once I killed the pool, everything runs fine.
    Does anyone happen to know why this is? I keep CFMX under its own thread pool because there are certain elements to CFMX that aren't wholly stable and can result in CFMX crashing. If it crashes, the process keeps accepting requests, but never processes them. I'd like to keep the native thread pool free to keep accepting non-CFMX requests even when CFMX crashes.
    Thus the separate thread pool for CFMX.
    But now I can't run CFMX in a separate thread pool with JAVA enabled.
    Anyone have any insights into why this is?
    Thanks

    Two things. Firstly, it's better to use     private static final Object classLock = new Object();because that saves you worrying about whether any other code synchronises on it. Secondly, if you do decide to go for the delegation route then java.lang.reflect.Proxy may be a good way forward.

  • Thread pool configuration for write-behind cache store operation?

    Hi,
    Does Coherence have a thread pool configuration for the Coherence CacheStore operation?
    Or the CacheStore implementation needs to do that?
    We're using write-behind and want to use multiple threads to speed up the store operation (storeAll()...)
    Thanks in advance for your help.

    user621063 wrote:
    Hi,
    Does Coherence have a thread pool configuration for the Coherence CacheStore operation?
    Or the CacheStore implementation needs to do that?
    We're using write-behind and want to use multiple threads to speed up the store operation (storeAll()...)
    Thanks in advance for your help.Hi,
    read/write-through operations are carried out on the worker thread (so if you configured a thread-pool for the service the same thread-pool will be used for the cache-store operation).
    for write-behind/read-ahead operations, there is a single dedicated thread per cache above whatever thread-pool is configured, except for remove operations which are synchronous and still carried out on the worker thread (see above).
    All above is of course per storage node.
    Best regards,
    Robert

  • Thread pool executor problem

    When using a thread pool executor (java.util.concurrent.ThreadPoolExecutor) to limit the number of threads executing at a time, the number of threads running still exceeds the limit number.
    This is the code:
    private ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(2, 3, 20, TimeUnit.SECONDS, new LinkedBlockingQueue());
    The number of tasks in my program are 4, so i always have 4 threads running, although i limited it to 3.
    Can anyone help me with this problem? Or can u propose another solution to limit the number of running threads? By the way, i also tried using a newFixedThreadPool() and got the same problem.
    Thx.

    The number of tasks in my program are 4, so i always
    have 4 threads running, although i limited it to 3.How do you know that there are 4 threads running? If you're generating a JVM thread dump, you're going to see threads that are used internally by the JVM.
    Here's a simple program that creates a fixed-size threadpool and runs jobs. It limits the number of concurrent threads to 3. Compare it to what you're doing, I'm sure that you'll find something different. Also, verify that you're not creating threads somewhere else in your program; all of the ThreadPoolExecutor threads will have names of the form "pool-X-thread-Y"
    import java.util.concurrent.Executors;
    import java.util.concurrent.ExecutorService;
    public class ThreadPoolTest {
        public static void main(String[] args) {
            ExecutorService pool = Executors.newFixedThreadPool(3);
            for (int ii = 0 ; ii < 10 ; ii++) {
                pool.execute(new MyRunnable());
            pool.shutdown();
        private static class MyRunnable implements Runnable {
            public void run() {
                log("running");
                try {
                    Thread.sleep(1000L);
                catch (InterruptedException e) {
                    log("interrupted");
            private void log(String msg) {
                System.err.println(
                        msg + " on " + Thread.currentThread().getName()
                        + " at " + System.currentTimeMillis());
    }

  • The problem in the thread pool implemented by myself

    Hello, I need to a thread pool in J2ME CDC 1.0 + FP 1.0, so I implemented a simple one by myself that also meets my own requirement.
    Here is the main idea:
    The thread pool creates a fixed number of threads in advance. When a task comes, it is put in the waiting list. All threads tries to get the tasks from the waiting list. If no task exists, the threads wait until someone wakes them up.
    Here are the requirements from myself:
    1. when a task has finished its work in one execution, it is put in the waiting list for the next run.
    2. the task can control the delay between when the task owner tries to put it in the waiting list and when the task is actually put in the waiting list. I need this function because sometimes I don't want the tasks to run too often and want to save some CPU usage.
    In my program, I creates two thread pools. In one pool, every task don't use the delay, and the thread pool works very well. The other pool has the tasks that use the delay, and sometimes, as I can see from the printed information, there are many tasks in the waiting list but 0 or 1 thread executes tasks. It seems that the waiting threads cannot wake up when new tasks comes.
    I suspect the code in addTask(), but cannot find the reason why it fails. Could anyone please help me find out the bug in my code? I put the code of thread pool below
    Thank you in advance
    Zheng Da
    ThreadPool.java
    package j2me.concurrent;
    import java.util.LinkedList;
    import java.util.Timer;
    import java.util.TimerTask;
    import alvis.general.Util;
    public class ThreadPool {
         private int maxQueueSize;
         private boolean running = true;
         private Thread[] threads;
         private LinkedList tasks = new LinkedList();
         private Timer timer = new Timer(true);
         private AtomicInteger usingThreads = new AtomicInteger(0);
         private synchronized boolean isRunning() {
              return running;
         private synchronized void stopRunning() {
              running = false;
         private synchronized PoolTask getTask() {
              while (tasks.isEmpty() && isRunning()) {
                   try {
                        this.wait();
                   } catch (InterruptedException e) {
                        e.printStackTrace();
              if (tasks.isEmpty())
                   return null;
              // Util.log.info(Thread.currentThread().getName() +
              // " gets a task, left tasks: " + tasks.size());
              return (PoolTask) tasks.removeFirst();
         private synchronized void addTaskNoDelay(PoolTask task) {
              tasks.addLast(task);
              notifyAll();
         private synchronized void addTask(final PoolTask task) {
              long delay = task.delay();
              if (delay == 0) {
                   addTaskNoDelay(task);
              } else {
                   timer.schedule(new TimerTask() {
                        public void run() {
                             addTaskNoDelay(task);
                   }, delay);
         private synchronized int numTasks() {
              return tasks.size();
         private class PoolThread extends Thread {
              public void run() {
                   Util.poolThreads.inc();
                   while (isRunning()) {
                        PoolTask task = getTask();
                        if (task == null) {
                             Util.poolThreads.dec();
                             return;
                        usingThreads.inc();
                        long currentTime = System.currentTimeMillis();
                        task.run();
                        long elapsedTime = System.currentTimeMillis() - currentTime;
                        if (elapsedTime > 100)
                             System.err.println(task.toString() + " takes " + ((double) elapsedTime)/1000 + "s");
                        usingThreads.dec();
                        if (!task.finish()) {
                             addTask(task);
                   Util.poolThreads.dec();
         public ThreadPool(int size, int taskQueueSize) {
              maxQueueSize = taskQueueSize;
              threads = new Thread[size];
              for (int i = 0; i < threads.length; i++) {
                   threads[i] = new PoolThread();
                   threads.start();
         public synchronized boolean executor(PoolTask task) {
              if (!isRunning()) {
                   return false;
              Util.log.info("Thread Pool gets " + task + ", there are "
                        + numTasks() + " waiting tasks");
              if (numTasks() >= maxQueueSize) {
                   return false;
              addTask(task);
              return true;
         public synchronized void destroy() {
              stopRunning();
              timer.cancel();
              // TODO: I am not sure it can wake up all threads and destroy them.
              this.notifyAll();
         public synchronized void printSnapshot() {
              System.err.println("using threads: " + usingThreads + ", remaining tasks: " + tasks.size());
    PoolTask.javapackage j2me.concurrent;
    public interface PoolTask extends Runnable {
         * It shows if the task has already finished.
         * If it isn't, the task will be put in the thread pool for the next execution.
         * @return
         boolean finish();
         * It shows the delay in milliseconds that the task is put in the thread pool.
         * @return
         long delay();

    are receiving/sends tasks packets time consuming operation in your case or not? if it is not you do not need to use thread pools at all. you can create a queue like in your code through the linked list and dispatch this queue periodically with minimum monitor usage. try this.
    import java.util.LinkedList;
    public class PacketDispatcher extends Thread {
        LinkedList list = new LinkedList();
        public PacketDispatcher (String name) {
            super(name);
        public void putTask(Task task) {
            synchronized (list) {
                list
                        .add(task);
                list.notify();
        public void run() {
            while (true/* your condition */) {
                Task task = null;
                synchronized (list) {
                    while (list.isEmpty())
                        try {
                            list.wait();
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                    task = (Task)list
                            .poll();
                if (task == null) {
                    try {
                        Thread
                                .sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    continue;
                task
                        .run();
                if (!task.isFinished()) {
                    putTask(task);
                Thread
                        .yield();
        public static void main(String[] args) {
            // just for test
            try {
                Thread.sleep (10000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            PacketDispatcher dispatcher = new PacketDispatcher("Packet Dispatcher");
            Task task = new Task();
            dispatcher.putTask(task);
            dispatcher.start();
            try {
                Thread.sleep (10000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            Task task2 = new Task();
            dispatcher.putTask(task2);
    class Task {
        long result = 0;
        public boolean isFinished () {
            if (getResult() >= 10000000) {
                return true;
            return false;
        public void run() {
            for (int i = 0; i < 1000; i++) {
                result += i;
        public long getResult () {
            return result;       
    }

  • Fixed Size Thread Pool which infinitely serve task submitted to it

    Hi,
    I want to create a fixed size thread pool say of size 100 and i will submit around 200 task to it.
    Now i want it to serve them infinitely i.e once all tasks are completed re-do them again and again.
    public void start(Vector<String> addresses)
          //Create a Runnable object of each address in "addresses"
           Vector<FindAgentRunnable> runnables = new Vector<FindAgentRunnable>(1,1);
            for (String address : addresses)
                runnables.addElement(new FindAgentRunnable(address));
           //Create a thread pool of size 100
            ExecutorService pool = Executors.newFixedThreadPool(100);
            //Here i added all the runnables to the thread pool
             for(FindAgentRunnable runnable : runnables)
                    pool.submit(runnable);
                pool.shutdown();
    }Now i wants that this thread pool execute the task infinitely i.e once all the tasks are done then restart all the tasks again.
    I have also tried to add then again and again but it throws a java.util.concurrent.RejectedExecutionException
    public void start(Vector<String> addresses)
          //Create a Runnable object of each address in "addresses"
           Vector<FindAgentRunnable> runnables = new Vector<FindAgentRunnable>(1,1);
            for (String address : addresses)
                runnables.addElement(new FindAgentRunnable(address));
           //Create a thread pool of size 100
            ExecutorService pool = Executors.newFixedThreadPool(100);
            for(;;)
                for(FindAgentRunnable runnable : runnables)
                    pool.submit(runnable);
                pool.shutdown();
                try
                    pool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
                catch (InterruptedException ex)
                    Logger.getLogger(AgentFinder.class.getName()).log(Level.SEVERE, null, ex);
    }Can anybody help me to solve this problem?
    Thnx in advance.

    Ravi_Gupta wrote:
    *@ kajbj*
    so what should i do?
    can you suggest me a solution?Consider this thread "closed". Continue to post in your other thread. I, and all others don't want to give answers that already have been given.

  • Starvation in EJB/MDB thread pool ?

    I am re-posting this article including the acronym EJB in the subject so that the EJB experts don't overlook this question. This question was moved from the JMS newsgroup to this newsgroup by a BEA moderator.
    Our application receives 10 different types of messages on one queue each. Thus we have 10 queues (MQ as a Foreign JMS provider with MDBs in a WLS). We have MDBs processing each of these queues. The producer (mainframe) that sends messages to these queues operates in batch mode.
    Option (1) Configure all MDBs in the same custom thread pool. If a blast of 500 messages arrives on one of the queues and all the threads start consuming messages, what happens to new messages that arrive on other queues ? Do they have to wait until these 500 messages are processed ? I would like someone from the BEA JMS implementation team to comment on this.
    Option (2) Configure smaller custom thread pools - one for each queue. Solves the problem above. Let us say we allocate 2 threads per MDB in custom thread pools. This ensures that none of the queues starve, however, if there is a practical limit on the maximum number of threads that can be configured, then this option introduces an inefficiency. What if there are 200 messages in one queue and zero messages in all others ? We are allowing only two threads to process those 200 messages while the other threads just sit and watch.

    I am re-posting this article including the acronym EJB in the subject so that the EJB experts don't overlook this question. This question was moved from the JMS newsgroup to this newsgroup by a BEA moderator.
    Our application receives 10 different types of messages on one queue each. Thus we have 10 queues (MQ as a Foreign JMS provider with MDBs in a WLS). We have MDBs processing each of these queues. The producer (mainframe) that sends messages to these queues operates in batch mode.
    Option (1) Configure all MDBs in the same custom thread pool. If a blast of 500 messages arrives on one of the queues and all the threads start consuming messages, what happens to new messages that arrive on other queues ? Do they have to wait until these 500 messages are processed ? I would like someone from the BEA JMS implementation team to comment on this.
    Option (2) Configure smaller custom thread pools - one for each queue. Solves the problem above. Let us say we allocate 2 threads per MDB in custom thread pools. This ensures that none of the queues starve, however, if there is a practical limit on the maximum number of threads that can be configured, then this option introduces an inefficiency. What if there are 200 messages in one queue and zero messages in all others ? We are allowing only two threads to process those 200 messages while the other threads just sit and watch.

Maybe you are looking for

  • Delivery Split during creation of delivery for STO

    While creating a delivery for STO, delivery is being created for individual line items. On analysis of VL 033 message, I found that the delivery split is happening because of Function SH: Unloading Point. The message is <i>"delivery split due to conf

  • Regarding CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

    Hi Friends, I want to know, Can this module update the Class information? I can retrive class information using this function module, but i am not able to update the class information. If all of you know any other way to update class information. Ple

  • No sound witn powerpoint

    Since I upgraded to Snow Leopard, I have no sound for anything downloaded from email, including power point. I googled and it seems like a lot of people are experiencing the same thing,but no solutions were given. I hope someone here can help me. Tha

  • Create database tables from an xsd

    Is it possible to generate database table from a given xsd using toplink ? I want to use these tables to persist java objects obtained by unmarshalling the xml (corresponding to this xsd). Thanks in advance, Mahima

  • FiX lot size & minimum sale order qty .

    hi all We maintained minimum order quantity  for material ; can we put massage sale oraganization wise ie for SO IN01 Massage type is 'E" & for IN02 massage type is 'W" If my minimum order qty. is 10 then SAP will accept the sale order qty. with mult