def consumer(params, &block)
      session do |s|
        begin
          consumer = s.consumer(params)
          block.call(s, consumer)
        ensure
          consumer.close if consumer
        end
      end
    end
def consumer(params, &block)
      session do |s|
        begin
          consumer = s.consumer(params)
          block.call(s, consumer)
        ensure
          consumer.close if consumer
        end
      end
    end
Obtain a session from the pool and create a MessageConsumer.
 Pass both into the supplied block.
 Once the block is complete the consumer is closed and the session is
 returned to the pool.

 Parameters:
   queue_name: [String] Name of the Queue to return
               [Symbol] Create temporary queue
                  Mandatory unless :topic_name is supplied
     Or,
   topic_name: [String] Name of the Topic to write to or subscribe to
               [Symbol] Create temporary topic
                  Mandatory unless :queue_name is supplied
     Or,
   destination: [javaxJms::Destination] Destination to use

   selector:   Filter which messages should be returned from the queue
                  Default: All messages
   no_local:   Determine whether messages published by its own connection
                  should be delivered to it
                  Default: false

 Example
   session_pool.consumer(queue_name: 'MyQueue') do |session, consumer|
     message = consumer.receive(timeout)
     puts message.data if message
   end