How should I use sorted queues? : BEA Weblogic



How should I use sorted queues? : BEA Weblogic..

Answer / Simpal Chauhan

To use Sorted Queues in WebLogic Server, you can follow these steps:
1. Declare a JMS queue with the `XA` and `SORTED` options enabled. For example:
- `<resource-ref>
<res-ref-name>myqueue</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
<jndi-name>java:comp/env/myqueue</jndi-name>
</resource-ref>`
2. Send messages with the sort key specified. For example, in Java:
- `QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = (Queue) context.lookup("java:comp/env/myqueue");
TextMessage message = session.createTextMessage("This is a sorted message with sort key 10");
message.setJMSProperty("JMSXGroupID", "some-group");
message.setJMSPriority(DeliveryConstants.DEFAULT_PRIORITY);
message.setJMSMessageID(UUID.randomUUID().toString());
message.setStringProperty("JMSXSortedKey", "10");
sender.send(queue, message);`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Weblogic Interview Questions

What is t3 protocol?

1 Answers  


what is LDAP?

2 Answers   CTS,


Explain what are the ways in which the dns request of failed servers handled?

1 Answers  


What is the no_acknowledge acknowledge mode used for? : BEA Weblogic

1 Answers  


What is multicast Address?

4 Answers   Oracle, Satyam,


An instance of stateful session ejb when accessed simultaneously from more than one clients on same vm results in remoteexception or ejbexception. In case the client is a servlet thread, which of the techniques can be used to avoid remoteexception/ejbexception? : BEA Weblogic

1 Answers  


Write a program to bind string values in a preparedstatement?

1 Answers  


In how many formats we can deploy an application in wls??

1 Answers  


What is web.xml ?

1 Answers  


Can someone please tell me the basic differences between weblogic 8,9 and 10 versions

5 Answers  


What is Unicast?

1 Answers  


While packaging the web application defaultwebapp for deployment into the weblogic server, the home and remote interfaces of the enterprise beans used by the servlets should reside in which directory? : BEA Weblogic

1 Answers  


Categories