java - Executor Service framework with consumer code -


i planning write code that's similar producer , consumer using executorservice fixed threadpool , ibm mq messaging.

suppose consumer created 10 fixed threads. how handle if place 10 messages in consumer queue? how 10 consumer worker threads cover below scenarios?

  1. each worker thread take single message synchronously , process message?

  2. each consumer worker threads take these 10 message 1 worker thread per 1 message?

  3. after reading message second scenario above ,how each thread call executor service.is done concurrenly or synchronously.

  4. if there 20 messages in queue,how consumer worker thread takes these message,each thread takes 2 messages? if takes 1 message per 1 thread happen other 10 messages?

while processing above scenarios there webservice call , internal api method calls synchronous methods. there use if implement class process code concurrently?

i don't think it's idea implement producer/consumer scheme when have tools jms implemented, debugged, support many features , supported frameworks (like spring instance).

don't invent wheel!


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -