Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   PriorityQueueing for MDB (http://www.velocityreviews.com/forums/t946172-priorityqueueing-for-mdb.html)

sushil.prusty 05-14-2012 11:29 AM

PriorityQueueing for MDB
 
Hi

Can any one help out how to handle Priority Queuing in JMS using MDB. I have used below code in client side

QueueSender sender = session.createSender(queue);
ObjectMessage objectMsg = session.createObjectMessage();
for (int i = 1; i <= 5; i++) {
if (i == 1) {
sender.setPriority(2);
objectMsg.setObject(" Client Quiue value=" + 2);
//objectMsg.setJMSPriority(2);
//producer.send(objectMsg, DeliveryMode.PERSISTENT, 2, 10000);
}
if (i == 2) {
sender.setPriority(1);
objectMsg.setObject(" Client Quiue value=" + 1);
//objectMsg.setJMSPriority(1);
//producer.send(objectMsg, DeliveryMode.PERSISTENT, 1, 10000);
}
if (i == 3) {
sender.setPriority(7);
objectMsg.setObject(" Client Quiue value=" + 7);
//objectMsg.setJMSPriority(7);
//producer.send(objectMsg, DeliveryMode.PERSISTENT, 7, 10000);
}
if (i == 4) {
sender.setPriority(3);
objectMsg.setObject(" Client Quiue value=" + 3);
//objectMsg.setJMSPriority(3);
//producer.send(objectMsg, DeliveryMode.PERSISTENT, 3, 10000);
}
if (i == 5) {
sender.setPriority(6);
objectMsg.setObject(" Client Quiue value=" + 6);
//objectMsg.setJMSPriority(6);
//producer.send(objectMsg, DeliveryMode.PERSISTENT, 6, 10000);
}
System.out.println("JMS Message Send To MOM = "+sender.getPriority());
sender.send(objectMsg);
}


Even though it's not working because once we populate message into queue it will control by apps server.

Is there any alternative way to handle which will make 100 % sure priority queue.


All times are GMT. The time now is 08:55 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.