Class JMSUtil


  • public final class JMSUtil
    extends Object
    • Method Detail

      • receive

        public static javax.jms.Message receive​(javax.jms.Session session,
                                                javax.jms.Destination replyToDestination,
                                                String correlationId,
                                                long receiveTimeout,
                                                boolean pubSubNoLocal)
      • receive

        public static javax.jms.Message receive​(javax.jms.Session session,
                                                javax.jms.Destination replyToDestination,
                                                String correlationId,
                                                long receiveTimeout,
                                                boolean pubSubNoLocal,
                                                Exchange exchange)
      • convertJmsException

        public static RuntimeException convertJmsException​(javax.jms.JMSException e)
      • createCorrelationId

        public static String createCorrelationId​(String prefix,
                                                 long sequenceNum)
      • createAndSetPayload

        public static javax.jms.Message createAndSetPayload​(Object payload,
                                                            javax.jms.Session session,
                                                            String messageType)
                                                     throws javax.jms.JMSException
        Create a JMS of the appropriate type populated with the given payload.
        Parameters:
        payload - the message payload, expected to be either of type String or byte[] depending on payload type
        session - the JMS session
        messageType - the JMS message type
        Returns:
        a JMS of the appropriate type populated with the given payload
        Throws:
        javax.jms.JMSException
      • createQueue

        public static javax.jms.Queue createQueue​(javax.jms.Connection connection,
                                                  String name)
                                           throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException