类 JmsTemplate

    • 构造器详细资料

      • JmsTemplate

        public JmsTemplate()
        Create a new JmsTemplate for bean-style usage.

        Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.

        另请参阅:
        JmsAccessor.setConnectionFactory(javax.jms.ConnectionFactory)
      • JmsTemplate

        public JmsTemplate​(ConnectionFactory connectionFactory)
        Create a new JmsTemplate, given a ConnectionFactory.
        参数:
        connectionFactory - the ConnectionFactory to obtain Connections from
    • 方法详细资料

      • getDefaultDestination

        public Destination getDefaultDestination()
        Return the destination to be used on send/receive operations that do not have a destination parameter.
      • getDefaultDestinationName

        public String getDefaultDestinationName()
        Return the destination name to be used on send/receive operations that do not have a destination parameter.
      • isMessageIdEnabled

        public boolean isMessageIdEnabled()
        Return whether message IDs are enabled.
      • isPubSubNoLocal

        public boolean isPubSubNoLocal()
        Return whether to inhibit the delivery of messages published by its own connection.
      • getReceiveTimeout

        public long getReceiveTimeout()
        Return the timeout to use for receive calls (in milliseconds).
      • setDeliveryDelay

        public void setDeliveryDelay​(long deliveryDelay)
        Set the delivery delay to use for send calls (in milliseconds).

        The default is -1 (no delivery delay passed on to the broker). Note that this feature requires JMS 2.0.

      • getDeliveryDelay

        public long getDeliveryDelay()
        Return the delivery delay to use for send calls (in milliseconds).
      • isExplicitQosEnabled

        public boolean isExplicitQosEnabled()
        If "true", then the values of deliveryMode, priority, and timeToLive will be used when sending a message. Otherwise, the default values, that may be set administratively, will be used.
        返回:
        true if overriding default values of QOS parameters (deliveryMode, priority, and timeToLive)
        另请参阅:
        setDeliveryMode(int), setPriority(int), setTimeToLive(long)
      • getDeliveryMode

        public int getDeliveryMode()
        Return the delivery mode to use when sending a message.
      • getPriority

        public int getPriority()
        Return the priority of a message when sending.
      • getTimeToLive

        public long getTimeToLive()
        Return the time-to-live of the message when sending.
      • execute

        public <T> T execute​(SessionCallback<T> action)
                      throws JmsException
        从接口复制的说明: JmsOperations
        Execute the action specified by the given action object within a JMS Session.
        指定者:
        execute 在接口中 JmsOperations
        参数:
        action - callback object that exposes the session
        返回:
        the result object from working with the session
        抛出:
        JmsException - if there is any problem
      • execute

        public <T> T execute​(SessionCallback<T> action,
                             boolean startConnection)
                      throws JmsException
        Execute the action specified by the given action object within a JMS Session. Generalized version of execute(SessionCallback), allowing the JMS Connection to be started on the fly.

        Use execute(SessionCallback) for the general case. Starting the JMS Connection is just necessary for receiving messages, which is preferably achieved through the receive methods.

        参数:
        action - callback object that exposes the Session
        startConnection - whether to start the Connection
        返回:
        the result object from working with the Session
        抛出:
        JmsException - if there is any problem
        另请参阅:
        execute(SessionCallback), receive()
      • execute

        public <T> T execute​(ProducerCallback<T> action)
                      throws JmsException
        从接口复制的说明: JmsOperations
        Send messages to the default JMS destination (or one specified for each send operation). The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.
        指定者:
        execute 在接口中 JmsOperations
        参数:
        action - callback object that exposes the session/producer pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • execute

        public <T> T execute​(Destination destination,
                             ProducerCallback<T> action)
                      throws JmsException
        从接口复制的说明: JmsOperations
        Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.
        指定者:
        execute 在接口中 JmsOperations
        参数:
        destination - the destination to send messages to
        action - callback object that exposes the session/producer pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • execute

        public <T> T execute​(String destinationName,
                             ProducerCallback<T> action)
                      throws JmsException
        从接口复制的说明: JmsOperations
        Send messages to a JMS destination. The callback gives access to the JMS Session and MessageProducer in order to perform complex send operations.
        指定者:
        execute 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send messages to (to be resolved to an actual destination by a DestinationResolver)
        action - callback object that exposes the session/producer pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • send

        public void send​(MessageCreator messageCreator)
                  throws JmsException
        从接口复制的说明: JmsOperations
        Send a message to the default destination.

        This will only work with a default destination specified!

        指定者:
        send 在接口中 JmsOperations
        参数:
        messageCreator - callback to create a message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • send

        public void send​(Destination destination,
                         MessageCreator messageCreator)
                  throws JmsException
        从接口复制的说明: JmsOperations
        Send a message to the specified destination. The MessageCreator callback creates the message given a Session.
        指定者:
        send 在接口中 JmsOperations
        参数:
        destination - the destination to send this message to
        messageCreator - callback to create a message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • send

        public void send​(String destinationName,
                         MessageCreator messageCreator)
                  throws JmsException
        从接口复制的说明: JmsOperations
        Send a message to the specified destination. The MessageCreator callback creates the message given a Session.
        指定者:
        send 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        messageCreator - callback to create a message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • doSend

        protected void doSend​(Session session,
                              Destination destination,
                              MessageCreator messageCreator)
                       throws JMSException
        Send the given JMS message.
        参数:
        session - the JMS Session to operate on
        destination - the JMS Destination to send to
        messageCreator - callback to create a JMS Message
        抛出:
        JMSException - if thrown by JMS API methods
      • doSend

        protected void doSend​(MessageProducer producer,
                              Message message)
                       throws JMSException
        Actually send the given JMS message.
        参数:
        producer - the JMS MessageProducer to send with
        message - the JMS Message to send
        抛出:
        JMSException - if thrown by JMS API methods
      • convertAndSend

        public void convertAndSend​(Object message)
                            throws JmsException
        从接口复制的说明: JmsOperations
        Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter.

        This will only work with a default destination specified!

        指定者:
        convertAndSend 在接口中 JmsOperations
        参数:
        message - the object to convert to a message
        抛出:
        JmsException - converted checked JMSException to unchecked
      • convertAndSend

        public void convertAndSend​(Destination destination,
                                   Object message)
                            throws JmsException
        从接口复制的说明: JmsOperations
        Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
        指定者:
        convertAndSend 在接口中 JmsOperations
        参数:
        destination - the destination to send this message to
        message - the object to convert to a message
        抛出:
        JmsException - converted checked JMSException to unchecked
      • convertAndSend

        public void convertAndSend​(String destinationName,
                                   Object message)
                            throws JmsException
        从接口复制的说明: JmsOperations
        Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter.
        指定者:
        convertAndSend 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        message - the object to convert to a message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • convertAndSend

        public void convertAndSend​(Object message,
                                   MessagePostProcessor postProcessor)
                            throws JmsException
        从接口复制的说明: JmsOperations
        Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.

        This will only work with a default destination specified!

        指定者:
        convertAndSend 在接口中 JmsOperations
        参数:
        message - the object to convert to a message
        postProcessor - the callback to modify the message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • convertAndSend

        public void convertAndSend​(Destination destination,
                                   Object message,
                                   MessagePostProcessor postProcessor)
                            throws JmsException
        从接口复制的说明: JmsOperations
        Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.
        指定者:
        convertAndSend 在接口中 JmsOperations
        参数:
        destination - the destination to send this message to
        message - the object to convert to a message
        postProcessor - the callback to modify the message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • convertAndSend

        public void convertAndSend​(String destinationName,
                                   Object message,
                                   MessagePostProcessor postProcessor)
                            throws JmsException
        从接口复制的说明: JmsOperations
        Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. The MessagePostProcessor callback allows for modification of the message after conversion.
        指定者:
        convertAndSend 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        message - the object to convert to a message.
        postProcessor - the callback to modify the message
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receive

        public Message receive()
                        throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        This will only work with a default destination specified!

        指定者:
        receive 在接口中 JmsOperations
        返回:
        the message received by the consumer, or null if the timeout expires
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receive

        public Message receive​(Destination destination)
                        throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receive 在接口中 JmsOperations
        参数:
        destination - the destination to receive a message from
        返回:
        the message received by the consumer, or null if the timeout expires
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receive

        public Message receive​(String destinationName)
                        throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receive 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        返回:
        the message received by the consumer, or null if the timeout expires
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveSelected

        public Message receiveSelected​(String messageSelector)
                                throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        This will only work with a default destination specified!

        指定者:
        receiveSelected 在接口中 JmsOperations
        参数:
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        返回:
        the message received by the consumer, or null if the timeout expires
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveSelected

        public Message receiveSelected​(Destination destination,
                                       String messageSelector)
                                throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receiveSelected 在接口中 JmsOperations
        参数:
        destination - the destination to receive a message from
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        返回:
        the message received by the consumer, or null if the timeout expires
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveSelected

        public Message receiveSelected​(String destinationName,
                                       String messageSelector)
                                throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receiveSelected 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        返回:
        the message received by the consumer, or null if the timeout expires
        抛出:
        JmsException - checked JMSException converted to unchecked
      • doReceive

        protected Message doReceive​(Session session,
                                    Destination destination,
                                    String messageSelector)
                             throws JMSException
        Receive a JMS message.
        参数:
        session - the JMS Session to operate on
        destination - the JMS Destination to receive from
        messageSelector - the message selector for this consumer (can be null)
        返回:
        the JMS Message received, or null if none
        抛出:
        JMSException - if thrown by JMS API methods
      • doReceive

        protected Message doReceive​(Session session,
                                    MessageConsumer consumer)
                             throws JMSException
        Actually receive a JMS message.
        参数:
        session - the JMS Session to operate on
        consumer - the JMS MessageConsumer to receive with
        返回:
        the JMS Message received, or null if none
        抛出:
        JMSException - if thrown by JMS API methods
      • receiveAndConvert

        public Object receiveAndConvert()
                                 throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        This will only work with a default destination specified!

        指定者:
        receiveAndConvert 在接口中 JmsOperations
        返回:
        the message produced for the consumer or null if the timeout expires.
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveAndConvert

        public Object receiveAndConvert​(Destination destination)
                                 throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receiveAndConvert 在接口中 JmsOperations
        参数:
        destination - the destination to receive a message from
        返回:
        the message produced for the consumer or null if the timeout expires.
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveAndConvert

        public Object receiveAndConvert​(String destinationName)
                                 throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receiveAndConvert 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        返回:
        the message produced for the consumer or null if the timeout expires.
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveSelectedAndConvert

        public Object receiveSelectedAndConvert​(String messageSelector)
                                         throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        This will only work with a default destination specified!

        指定者:
        receiveSelectedAndConvert 在接口中 JmsOperations
        参数:
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        返回:
        the message produced for the consumer or null if the timeout expires.
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveSelectedAndConvert

        public Object receiveSelectedAndConvert​(Destination destination,
                                                String messageSelector)
                                         throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receiveSelectedAndConvert 在接口中 JmsOperations
        参数:
        destination - the destination to receive a message from
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        返回:
        the message produced for the consumer or null if the timeout expires.
        抛出:
        JmsException - checked JMSException converted to unchecked
      • receiveSelectedAndConvert

        public Object receiveSelectedAndConvert​(String destinationName,
                                                String messageSelector)
                                         throws JmsException
        从接口复制的说明: JmsOperations
        Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured MessageConverter.

        This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

        指定者:
        receiveSelectedAndConvert 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        返回:
        the message produced for the consumer or null if the timeout expires.
        抛出:
        JmsException - checked JMSException converted to unchecked
      • doConvertFromMessage

        protected Object doConvertFromMessage​(Message message)
        Extract the content from the given JMS message.
        参数:
        message - the JMS Message to convert (can be null)
        返回:
        the content of the message, or null if none
      • sendAndReceive

        public Message sendAndReceive​(MessageCreator messageCreator)
                               throws JmsException
        从接口复制的说明: JmsOperations
        Send a request message and receive the reply from a default destination. The MessageCreator callback creates the message given a Session. A temporary queue is created as part of this operation and is set in the JMSReplyTO header of the message.

        This will only work with a default destination specified!

        指定者:
        sendAndReceive 在接口中 JmsOperations
        参数:
        messageCreator - callback to create a request message
        返回:
        the reply, possibly null if the message could not be received, for example due to a timeout
        抛出:
        JmsException - checked JMSException converted to unchecked
      • sendAndReceive

        public Message sendAndReceive​(Destination destination,
                                      MessageCreator messageCreator)
                               throws JmsException
        从接口复制的说明: JmsOperations
        Send a message and receive the reply from the specified destination. The MessageCreator callback creates the message given a Session. A temporary queue is created as part of this operation and is set in the JMSReplyTO header of the message.
        指定者:
        sendAndReceive 在接口中 JmsOperations
        参数:
        destination - the destination to send this message to
        messageCreator - callback to create a message
        返回:
        the reply, possibly null if the message could not be received, for example due to a timeout
        抛出:
        JmsException - checked JMSException converted to unchecked
      • sendAndReceive

        public Message sendAndReceive​(String destinationName,
                                      MessageCreator messageCreator)
                               throws JmsException
        从接口复制的说明: JmsOperations
        Send a message and receive the reply from the specified destination. The MessageCreator callback creates the message given a Session. A temporary queue is created as part of this operation and is set in the JMSReplyTO header of the message.
        指定者:
        sendAndReceive 在接口中 JmsOperations
        参数:
        destinationName - the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver)
        messageCreator - callback to create a message
        返回:
        the reply, possibly null if the message could not be received, for example due to a timeout
        抛出:
        JmsException - checked JMSException converted to unchecked
      • browse

        public <T> T browse​(BrowserCallback<T> action)
                     throws JmsException
        从接口复制的说明: JmsOperations
        Browse messages in the default JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
        指定者:
        browse 在接口中 JmsOperations
        参数:
        action - callback object that exposes the session/browser pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • browse

        public <T> T browse​(Queue queue,
                            BrowserCallback<T> action)
                     throws JmsException
        从接口复制的说明: JmsOperations
        Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
        指定者:
        browse 在接口中 JmsOperations
        参数:
        queue - the queue to browse
        action - callback object that exposes the session/browser pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • browse

        public <T> T browse​(String queueName,
                            BrowserCallback<T> action)
                     throws JmsException
        从接口复制的说明: JmsOperations
        Browse messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
        指定者:
        browse 在接口中 JmsOperations
        参数:
        queueName - the name of the queue to browse (to be resolved to an actual destination by a DestinationResolver)
        action - callback object that exposes the session/browser pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • browseSelected

        public <T> T browseSelected​(String messageSelector,
                                    BrowserCallback<T> action)
                             throws JmsException
        从接口复制的说明: JmsOperations
        Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
        指定者:
        browseSelected 在接口中 JmsOperations
        参数:
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        action - callback object that exposes the session/browser pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • browseSelected

        public <T> T browseSelected​(Queue queue,
                                    String messageSelector,
                                    BrowserCallback<T> action)
                             throws JmsException
        从接口复制的说明: JmsOperations
        Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
        指定者:
        browseSelected 在接口中 JmsOperations
        参数:
        queue - the queue to browse
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        action - callback object that exposes the session/browser pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • browseSelected

        public <T> T browseSelected​(String queueName,
                                    String messageSelector,
                                    BrowserCallback<T> action)
                             throws JmsException
        从接口复制的说明: JmsOperations
        Browse selected messages in a JMS queue. The callback gives access to the JMS Session and QueueBrowser in order to browse the queue and react to the contents.
        指定者:
        browseSelected 在接口中 JmsOperations
        参数:
        queueName - the name of the queue to browse (to be resolved to an actual destination by a DestinationResolver)
        messageSelector - the JMS message selector expression (or null if none). See the JMS specification for a detailed definition of selector expressions.
        action - callback object that exposes the session/browser pair
        返回:
        the result object from working with the session
        抛出:
        JmsException - checked JMSException converted to unchecked
      • getConnection

        protected Connection getConnection​(JmsResourceHolder holder)
        Fetch an appropriate Connection from the given JmsResourceHolder.

        This implementation accepts any JMS 1.1 Connection.

        参数:
        holder - the JmsResourceHolder
        返回:
        an appropriate Connection fetched from the holder, or null if none found
      • getSession

        protected Session getSession​(JmsResourceHolder holder)
        Fetch an appropriate Session from the given JmsResourceHolder.

        This implementation accepts any JMS 1.1 Session.

        参数:
        holder - the JmsResourceHolder
        返回:
        an appropriate Session fetched from the holder, or null if none found
      • doCreateProducer

        protected MessageProducer doCreateProducer​(Session session,
                                                   Destination destination)
                                            throws JMSException
        Create a raw JMS MessageProducer for the given Session and Destination.

        This implementation uses JMS 1.1 API.

        参数:
        session - the JMS Session to create a MessageProducer for
        destination - the JMS Destination to create a MessageProducer for
        返回:
        the new JMS MessageProducer
        抛出:
        JMSException - if thrown by JMS API methods
      • createConsumer

        protected MessageConsumer createConsumer​(Session session,
                                                 Destination destination,
                                                 String messageSelector)
                                          throws JMSException
        Create a JMS MessageConsumer for the given Session and Destination.

        This implementation uses JMS 1.1 API.

        参数:
        session - the JMS Session to create a MessageConsumer for
        destination - the JMS Destination to create a MessageConsumer for
        messageSelector - the message selector for this consumer (can be null)
        返回:
        the new JMS MessageConsumer
        抛出:
        JMSException - if thrown by JMS API methods