EJB programming & troubleshooting: MDB performance dependent on sender Application type (C or Java)

  1. We are performance testing an application which primarily consists of MDBs. External applications send messages on IBM-MQ queues and MDBs are triggered to process these messages.

    While doing a backlog scenario testing, we observed a strange behaviour, in the MDBs. When we dump a load of messages (500 K) messages on the queue. Then stop the sender application and start the MDBs in the AppServer, the MDBs show a good performance only if the sender application is the one in C. But if send the same messages from a java stub (using JMS APIs or IBM-MQ Java APIs) the response significantly drops down. This behaviour is not exhibited if the queue depth is less than 100K.

    The high level process flow (execution) within the application, which is of significance for this issue is as follows –
    - Application is primarily asynchronous and all the core processing is based on MDBs which are triggered when messages are received from external applications.

    - Once an MDB is triggered and onMessage() is invoked by the container, the MDB processes that message, inserts in DB, and opens a JMSReceiver to read back more messages from its source queue.

    - There is a configurable parameter (BATCHSIZE) in the deployment descriptor of the MDB, which controls, how many messages can the MDB read back in single execution to process in chunks.

    - The default BATCHSIZE used in the MDBs is 30. Configuring it 1 makes the MDB behave as normal MDBs and no more messages are read back within same context.

    When messages are accummulated using Java feeder application, the performance of MDBs is real slow. But if we set the above BATCHSIZE parameter to 1, the performance improves and is comparable to normal performance.

    But if the feeder app is C, then MDBs perform pretty well, no matter what is the message length, queue depth or the BATCHSIZE parameter.

    We have already compared all preliminary stuff like, checking attributes and message headers (format, encoding, no jms-header, durability, persistence, priority etc.) and have ensured that messages from both applications(C and Java) are same in all respect possible by the APIs available.

    In case, you have read this problem definition so far, I appreciate your patience and would be hoping for some pointers to nail this issue.

  2. We have a integration scenario for two applications written in different languages. One end application is always going to be a J2EE application and we do not know who the other end can be.It might be a C application or a Java application. Basically needs to be a application with MQ interface available. The MQ message data i.e. data to be exchanged is always going to be a file which i can pass as a bytes array.Along with it, i need to pass some mandatory information everytime. The query is : Can I have a message with some application defined (custom) headers included(name value pair like OriginTransactionId=orgn1234565) in the message as well as the file sent as the chunk of the bytes i.e.message data? If this is possible, do all available sets of MQ APIs (Visual Basic, C, C++, Java,COBOL etc) support the setting / getting the application defined header values? If this is possible and somebody has already done this, PLEASE guide in detail. Thanks