Message Driven Bean Concurrency

10-11  Source: Network gathering  Views:0 

Advertisement
Hi:
I am working with message-driven beans (MDB). My understanding was that
these beans would read and execute concurrently. My tests show they do
not. I have setup a single MDB which contains the following trivial
implementation of onMessage...
public void onMessage(javax.jms.Message message) {
System.err.println("onMessage()");
try{
TextMessage tm = (TextMessage) message;
String text = tm.getText();
System.err.println("Received new message: " + text);
// Simulate non-trivial business process that takes ~10
seconds.
Thread.currentThread().sleep(10000);
}catch(Exception e){
e.printStackTrace();
Now I have a little test application that throws ten messages into the
queue. Each message is consumed from the queue SEQUENTIALLY which is
not my understanding of concurrent processing. So in all sending ten
messages to the queue each message is processed in turn taking 100 seconds
for the whole thing to complete instead of 10 MDB instances all chewing on
a different message and the whole thing would complete in roughly 10
seconds.
Is there a setup step that I have missed? I have bumped the
default.properties file messagebean.pool.size=30 from its default of 3.
It does create 10 bean instances, what for I don't know...
Thanks
Steve
Message beans are used for asynchronous calls, meaning that the container decides in what order to execute them. If you want to achieve concurrent calls consider using Session Beans.
Regards,
Dimitar
Related articles
  • Message Driven Bean Concurrency 10-11

    Hi: I am working with message-driven beans (MDB). My understanding was that these beans would read and execute concurrently. My tests show they do not. I have setup a single MDB which contains the following trivial implementation of onMessage... publ

  • Can you set isolation levels of message-driven bean transactions? 10-11

    The problem: I have 3 different message-driven beans which each get a different type of message, except for a field that is common to all. That field is used as the primary key of an entity object. The message-driven beans configured to use a contain

  • Message Driven Bean -- Instance Creation.. 10-11

    As we know MDB (inJMS) acts as a listener to a message coming from either a topic/queue. The instance of MDB is created by the EJB Container and the no. of instances created depend upon the corresponding values specified in the Deployment-Descriptor.

  • Question about message driven bean 11-30

    hello i can find tons of tutoriala about developing session bean and entity bean by using jdeveloper,but can't find even one article that tell me how to develop message driven bean and jms by using jdeveloper,who can help me,where can i find such tut

  • Message Driven Beans 11-30

    Hi, I am building a simple dispatcher around Message Driven Beans. I have a simple test program - MDB : onMessage sleeps for 10 seconds. Client: sends 100 messages I notected the following: 1. Only 13 messages are processed concurrently 2. Client is

  • Message-driven beans Vs JMS 11-30

    Hi, what does the bean technology add to the JSM by using the message driven beans instead of just using the regular asynchronus JMS?that's my question when and why should we chose: 1. simple asynchronous JMS 2. message-driven beansYou presumably mea

  • How to transaction in the message driven bean? 10-11

              hello           i write a message driven bean,that monitor the weblogic message queue,when a "Order"           object is witten to the queue,the mdb get it and write it to a entity bean "Orderinfo".all           of above logi

  • Message Driven Bean and transaction handling 10-11

    We are using container managed transactions with MDB's running on OC4J version 10.1.2. We have two database serveres, both running Oracle 10g. The MDB consume messages from the AQ-database through JMS (connected to a JDBC datasource registered as "jd

  • WebLogic 10 and EJB 3.0 for Message Driven Bean 10-11

    Hi, I am trying to deploy Message Driven Bean using EJB3.0 on weblogic 10. I am using annotations and don't want to use deployment descriptors. The Bean class: CalculatorBean.java import javax.ejb.*; import javax.jms.*; import java.sql.Timestamp; imp

  • JBoss message driven bean calling a session bean 10-11

    Hi guys, can you please help me? I want my mdb to call my session bean....can you provide me some examples of ejb-jar.xml and jboss.xml with regards to this configuration....thanks...im creating my deployment descriptors manuallyHere is a little exam

  • Message Driven Bean: problem with @RunAs annotation 10-11

    I am having a problem using the @RunAs annotation in a message driven bean. I would like the code in my onMessage() method to be executed with a specific role/user, so I want to use the @RunAs annotation to achieve this. I am running weblogic 10.0. I

  • Error during deployment of Message Driven Bean 10-11

    Environment: WLS 6.1SP3 on Win2K SP2, non-clustered.           I am getting some error (or perhaps warning) during deployment of Message           Driven Bean. Any one seen this before?           This error only comes on a machine with Dual Network c

  • Message Acknowledgement in a Message Driven Bean 10-11

    Does the message acknowledgement in a Message driven bean take place after the transaction commits? Will the message be available to be consumed by another instance of the MDB in case the transaction was rolled back? I am using WLS 7.0 as my app serv

  • Create EJB 3.0 Message Driven Bean on a Oracle JMS (AQ) 10-11

    Hi, I need to develop a EJB 3.0 Message Driven Bean. The MDB has to work on a Oracle AQ using Oracle JMS. Is there any how-to document giving an example about this issue. Can you give an example how to create the JMS destination in OC4J (how to confi

  • Exception in setting up message-driven bean container: [MQJMS1010: not impl 10-11

    Problem ======= We are trying to configure and deploy a Message Driven Bean to listen on a WebSphere MQ queue, using LDAP to share knowledge of the Queue & Connection Factory. But when we start the Sun One domain we get an exception: javax.jms.JMSExc

  • Exception in setting up message-driven bean container 10-11

    hello, I'm trying to deploy a single mdb and I'm getting an exception. I've tried closely following the way things are done with the mdb example in the samples AppServer7 directory. Am I missing something in one of my deployment descriptior files? Th

  • ERROR WHEN START ESR: Cannot activate endpoint for message-driven bean 10-11

    Hi Gurus, We just upgraded our PI 7.1 to SP11, and we have finished it successfully, then we go to the /rep/start/repository.jnlp to start the ESR but some error happens,while the ID,SLD and RWB works well, below is the detailed message: Application

  • Error when ESR starts - Cannot activate endpoint for message-driven bean 10-11

    Hi, as already posted on ERROR WHEN START ESR: Cannot activate endpoint for message-driven bean after an upgrade to PI 7.1 SP11, we got the following error when trying to start ESR, other applications work well: Application cannot be started! Details

  • JNDI Naming Problem accessing Session Bean from Message Driven Bean 10-11

    Hi,      I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocat

  • Usage of Apache Beehive JMS control inside Message Driven Bean 10-11

    Hi, I am developing a j2ee application using weblogic workshop 10.3. This application contains the following three projects. - J2EE Utility Project - Message Driven Bean Project - Ear Project In the Utility project I have created one apache beehive j