How message acknowledgement works?

Hi everyone,

I am using Sun Message Queue 3.5 Platform Edition. The messages are remaining in the Queue. According to me, the messages should remain in the queue if they are not recieved by the listener and acknowledged. Please rectify me if I am wrong.

I am using PTP. I am using following method called while cerating Session

QueueSession queuesession = conn.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE );

And using following code while sending the message:

queueSender.send(message);

Or shall I use the following:

queueSender.send(message, DeliveryMode.PERSISTENT, 0, 0L);

I am trying to send the messages to the queue, the listener to the queue fetches the data from the queue and stores in the database. What I want is, the messages should remain in the queue, if the database connection is lost temporaraily.

Are the messages PERSISTENT only when the Message Queue fails or We can make the messages to remain in the queue till the time we want by not acknowledging them?

Please help

Hitesh

[1101 byte] By [hitsum] at [2007-11-25 17:59:39]
# 1

> Hi everyone,

>

> I am using Sun Message Queue 3.5 Platform Edition.

> on. The messages are remaining in the Queue.

> According to me, the messages should remain in the

> e queue if they are not recieved by the listener and

> acknowledged. Please rectify me if I am wrong.

Correct. Also if the message was sent with the time-to-live set then the message may be removed from the queue when the message expires.

>

> I am using PTP. I am using following method

> method called while cerating Session

>

> QueueSession queuesession =

> = conn.createQueueSession(false,

> Session.CLIENT_ACKNOWLEDGE );

>

> And using following code while sending the message:

>

> queueSender.send(message);

>

> Or shall I use the following:

>

>

> queueSender.send(message, DeliveryMode.PERSISTENT, 0,

> 0L);

>

By default produced messages are persistent so you can use either method.

> I am trying to send the messages to the queue, the

> listener to the queue fetches the data from the queue

> and stores in the database. What I want is, the

> messages should remain in the queue, if the database

> connection is lost temporaraily.

>

> Are the messages PERSISTENT only when the

> n the Message Queue fails or We can make the messages

> to remain in the queue till the time we want by not

> acknowledging them?

>

When you produce persistent messages the send() method will not return until the broker has persisted the message.This protects the messages from being lost in case the broker goes down.

Chris

http://wwws.sun.com/software/products/message_queue/index.html

> Please help

>

> Hitesh

kasso at 2007-7-3 15:32:03 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...