In the JMS API doc, it said:
public Message receive() throws JMSExceptionReceives the next message produced for this message consumer. This call blocks indefinitely until a message is produced or until this message consumer is closed.
If this receive is done within a transaction, the consumer retains the message until the transaction commits.
Here I have three questions: 1. in the code, do we need while-loop to receive message ? like:
while(true){
Message msg = queue.receive();
....
}
what is the transaction setting ? how to commit a transaction ? like this:
boolean transacted = false; session = connection.createQueueSession(transacted, Session.AUTO_ACKNOWLEDGE);receiveNoWait() has transaction support ? how to use it ?
Thanks