| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Advanced Queuing
Hi,
I realized the exact position, where the delay occurs. The important
part of my code looks 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);
}
If I use this code with a transacted QueueSession the delay occurs in onMessage at m_qsession.commit(). The first times this call takes only a few milli seconds - not more than 100-200 ms, often less than 100 ms. But with the time this increases to more than 1000 ms. If I don't use a transacted QueueSession by replacing
m_qsession = m_qconn.createQueueSession(
true, Session.CLIENT_ACKNOWLEDGE);
with
m_qsession = m_qconn.createQueueSession(
false, Session.AUTO_ACKNOWLEDGE);
in initQueueSession, there is the same behaviour in
m_sender_seekAnswer.send(msgAnswer);
Do you have any ideas, what could cause this problem?
Thanks, Christian Received on Mon Aug 23 2004 - 07:58:43 CDT
![]() |
![]() |