class JMSMessageConsumer {

  void close() {
    try {
      if (session != null) {
        session.close();
      }
    } catch (JMSException e) {
      logger.error("Could not destroy session", e);
    }
    try {
      if (connection != null) {
        connection.close();
      }
    } catch (JMSException e) {
      logger.error("Could not destroy connection", e);
    }
  }

    JMSMessageConsumer(InitialContext initialContext, ConnectionFactory connectionFactory,
                     String destinationName, JMSDestinationLocator destinationLocator,
                     JMSDestinationType destinationType, String messageSelector, int batchSize,
                     long pollTimeout, JMSMessageConverter messageConverter,
                     Optional<String> userName, Optional<String> password,
                     Optional<String> clientId, boolean createDurableSubscription,
                     String durableSubscriptionName);

}