6. In-depth analysis of the peer-to-peer model

1. Two ways to ensure the uniqueness of the message

     a. Associate MessageId with JMSCorrelationID

     b. Use the java UUID class to generate a unique ID

           UUID uuid = UUID.randomUUID();

           uuid.toString();

2. Dynamic queue versus managed queue

      dynamic queue

     QueueSession.createQueue(String queueName); returns the Queue object in the messaging system

     Can read all the lists in the queue

      QueueSession.createTemporaryQueue() method, a JMS client can use this method to create a temporary queue, and this temporary queue can only be consumed by the JMS client

     managed queue

     Queues defined in the jms service provider configuration file or management tool

3. Use multiple receivers to achieve load balancing

     This is not considered by our program developers, the service is provided by the jms service provider

4. How to get all the lists in the queue

      QueueBrower browser = session.createBrowser(String queuename);

      Enumeration e= brower.getEnumeration();

      while(e.hasMoreElements)

      {

        }

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326918930&siteId=291194637