protected Connection createConnection() {
    LOG.info("Will create new JMS connection");
    Context jndiCntxt;
    Connection jmsConnection = null;
    try {
      jndiCntxt = new InitialContext();
      ConnectionFactory connFac = (ConnectionFactory) jndiCntxt.lookup("ConnectionFactory");
      jmsConnection = connFac.createConnection();
      jmsConnection.start();
      jmsConnection.setExceptionListener(new ExceptionListener() {
        @Override
        public void onException(JMSException jmse) {
          LOG.error("JMS Exception listener received exception. Ignored the error", jmse);
        }
      });
    } catch (NamingException e) {
      LOG.error("JNDI error while setting up Message Bus connection. "
        + "Please make sure file named 'jndi.properties' is in "
        + "classpath and contains appropriate key-value pairs.", e);
    } catch (JMSException e) {
      LOG.error("Failed to initialize connection to message bus", e);
    } catch (Throwable t) {
      LOG.error("Unable to connect to JMS provider", t);
    }
    return jmsConnection;
  }
Create the JMS connection
@return newly created JMS connection
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/NotificationListener.java