Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > PriorityQueueing for MDB

Reply
Thread Tools

PriorityQueueing for MDB

 
 
sushil.prusty sushil.prusty is offline
Junior Member
Join Date: May 2012
Posts: 1
 
      05-14-2012
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MDB to MDB Event Notification John Schult Java 0 05-04-2005 01:26 AM
Faster access to MDB? MS Access MDB and ASP =?Utf-8?B?UGhpbA==?= ASP .Net 8 01-27-2005 07:08 PM
Needed Visual Basic 6 Data.mdb's for course? J Microsoft Certification 2 10-23-2003 08:07 PM
Chateau.mdb required Dennis Bushuven MCSD 0 09-15-2003 02:23 PM
win32 adodb/mdb; con.execute returns undef and not recordset. Vikas Yadav Perl 0 09-09-2003 09:10 AM



Advertisments