PriorityQueueing for MDB

Discussion in 'Java' started by sushil.prusty, May 14, 2012.

  1. sushil.prusty

    sushil.prusty

    Joined:
    May 14, 2012
    Messages:
    1
    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.
    sushil.prusty, May 14, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vikas Yadav
    Replies:
    0
    Views:
    1,117
    Vikas Yadav
    Sep 9, 2003
  2. Dave
    Replies:
    1
    Views:
    532
    Anthony Williams
    Sep 10, 2003
  3. A.M

    Creating an MDB/XLS file

    A.M, Oct 28, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,201
    Chris Becker
    Oct 30, 2003
  4. =?Utf-8?B?UGhpbA==?=

    Faster access to MDB? MS Access MDB and ASP

    =?Utf-8?B?UGhpbA==?=, Jan 26, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    459
    Kevin Spencer
    Jan 27, 2005
  5. John  Schult

    MDB to MDB Event Notification

    John Schult, May 4, 2005, in forum: Java
    Replies:
    0
    Views:
    462
    John Schult
    May 4, 2005
Loading...

Share This Page