private MessageConsumer getConsumer ( final String destinationName ) { if ( ! consumers . containsKey ( destinationName ) ) { Session session = getSession ( ) ; Destination destination = getDestination ( destinationName ) ; try { MessageConsumer consumer = session . createConsumer ( destination ) ; consumers . put ( destinationName , consumer ) ; } catch ( JMSException e ) { throw new JmsException ( "Unable to create consumer for destination " + destinationName , e ) ; } } return consumers . get ( destinationName ) ; }
Get the MessageConsumer .