|
| |
"Guaranteed Messaging With JMS"
Vol. 6, Issue 4, p. 24
Listing 1
public void onMessage(javax.jms.Message message){
int count = 1000;
try{
// perform some business logic with the message
...
message.acknowledge();
// perform more business logic with the message
...
}catch (javax.jms.JMSException jmse){
// catch the exception thrown and undo the results
// of partial processing
...
}
}
Listing 2
// pub/sub connection creates a transacted TopicSession
javax.jms.TopicSession session =connect.createTopicSession(true,Session.AUTO_ACKNOWLEDGE);
// p2p connection creates a transacted QueueSession
javax.jms.QueueSession =
connect.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
...
}
|
|
All Rights Reserved
Copyright © 2004 SYS-CON Media, Inc.
E-mail: info@sys-con.com
Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.
|