performance problem with JMS

  • Thread starter Christian \Raistlin\ Gulich
  • Start date
C

Christian \Raistlin\ Gulich

Hi,

I use JMS for communication between a client and a "server", which is
executed in an oracle database. Oracle supplies "Advanced Queuing",
which implements the JMS-Interfaces.
The first messages are sent very fast, often less than 100ms. But when
time goes on, this time increases to more than one second. My code
implements a MessageListener, where the server receives messages from
the clients and processes them. The important parts look like this:

QueueConnection m_qconn;
QueueSession m_qsession;
QueueSender m_sender_seekAnswer;

public void onMessage (Message m) {
try {
MapMessage msg = (MapMessage)m;
long newPos = msg.getLong("newPosition");
long answer;
...
MapMessage msgAnswer=streamvideo.m_qsession.createMapMessage();
msgAnswer.setLong("newPosition", answer);
m_sender_seekAnswer.send(msgAnswer);
m_qsession.commit();
}
catch (JMSException ex) {
}
}

where m_qsession and m_sender_seekAnswer are initialized in these methods:

private void initQueueSession () {
QueueConnectionFactory qcfact;
m_qsession = null;
try {
qcfact = AQjmsFactory.getQueueConnectionFactory(
"host", "TestDB", 1521, "thin");
m_qconn = qcfact.createQueueConnection("Tester", "pass");
m_qsession = m_qconn.createQueueSession(
true, Session.CLIENT_ACKNOWLEDGE);
m_qconn.start();
}
catch (Exception ex) {
}
}


private void initSender() throws AQException, JMSException {
Queue queue;
queue=((AQjmsSession)m_qsession).getQueue("TESTER", "JMS_ANSWER_Q");
m_sender_seekAnswer=((AQjmsSession)m_qsession).createSender(queue);
}


The described delay occurs at
m_qsession.commit();

If I do not use a transacted QueueSession and create m_qsession with
m_qsession = m_qconn.createQueueSession(
false, Session.AUTO_ACKNOWLEDGE);
the same beviour accours at
m_sender_seekAnswer.send(msgAnswer);


Do you have any ideas, what could cause this problem?
Besides the sender there is a receiver too, which is created from
m_qsession. Maybe this is a problem?

Thanks in advance
Christian

X'Post: comp.lang.java.programmer, comp.lang.java.databases
F'up: comp.lang.java.programmer
 
P

Paul Lutus

Christian "Raistlin" Gulich wrote:

/ ...
Do you have any ideas, what could cause this problem?

Most likely there are unused objects on the heap that are not being
destroyed. Why not monitor your application's memory usage over time to see
if this is a factor?

Make sure there are no unused object references that remain in scope,
preventing the garbage collector from reclaiming them.
Besides the sender there is a receiver too, which is created from
m_qsession. Maybe this is a problem?

About this, we can give you exactly as much information as you have given
us.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top