This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set Message priority for JMS MQ?  RSS feed

bala.v reddy
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using JMS with MQ. If i set message priority in sender program, messages are not storing in priority order in MQ Queue. stores as FIFO. When i executed JMS with Weblogic, in weblogic, i set priorities for Q (sort by, priority,..). it works fine in weblogic.

I think the same has to be done in MQ Queue level also.

Here is the sample code for JMS MQ.

mqFactory = new MQQueueConnectionFactory();
if( aQueueMagager== null) {aQueueMagager = new String();}
if( aPort== null) { aPort= new String("1414");}
if( mqChannel == null) { mqChannel = new String(this.CHANNEL);}
if( aServer == null) {aServer = new String("localhost");}

queueConnection = mqFactory.createQueueConnection();
System.out.println("After queueConnection");
Queue tmp_queue = this.getQueueSession().createQueue("SCE3JMS");
qsender = this.getQueueSession().createSender(tmp_queue);
msg = this.getQueueSession().createTextMessage();
queueConnection .start();

msg.setText(new String("test :"+prio));


anybody tell me how to set MQ Queue msg priorites as message specific.
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont post the same question more than once.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!