• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

message proority in JMS MQ

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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");}
System.out.println("aServer:"+aServer);
((MQQueueConnectionFactory)mqFactory).setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
((MQQueueConnectionFactory)mqFactory).setQueueManager(aQueueMagager);
((MQQueueConnectionFactory)mqFactory).setHostName(aServer);
((MQQueueConnectionFactory)mqFactory).setChannel(mqChannel);
((MQQueueConnectionFactory)mqFactory).setPort(Integer.decode(aPort).intValue());

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));
msg.setJMSPriority(prio);

qsender.send(msg);
qsender.close();

anybody tell me how to set MQ Queue msg priorites as message specific.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

A JMS provider tries to deliver higher-priority messages before lower-priority ones but does not have to deliver messages in exact order of priority.

 
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic