Search in sources :

Example 1 with JMSAccessorService

use of org.apache.oozie.service.JMSAccessorService in project oozie by apache.

the class TestJMSSLAEventListener method getConnectionContext.

private ConnectionContext getConnectionContext() {
    Configuration conf = services.getConf();
    String jmsProps = conf.get(JMSJobEventListener.JMS_CONNECTION_PROPERTIES);
    JMSConnectionInfo connInfo = new JMSConnectionInfo(jmsProps);
    JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);
    ConnectionContext jmsContext = jmsService.createConnectionContext(connInfo);
    return jmsContext;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) JMSAccessorService(org.apache.oozie.service.JMSAccessorService)

Example 2 with JMSAccessorService

use of org.apache.oozie.service.JMSAccessorService in project oozie by apache.

the class JMSExceptionListener method onException.

@Override
public void onException(JMSException exception) {
    LOG.warn("Received JMSException for [{0}]", connInfo, exception);
    connCtxt.close();
    if (retry) {
        JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);
        jmsService.reestablishConnection(connInfo);
    }
}
Also used : JMSAccessorService(org.apache.oozie.service.JMSAccessorService)

Example 3 with JMSAccessorService

use of org.apache.oozie.service.JMSAccessorService in project oozie by apache.

the class TestJMSJobEventListener method getConnectionContext.

private ConnectionContext getConnectionContext() {
    Configuration conf = services.getConf();
    String jmsProps = conf.get(JMSJobEventListener.JMS_CONNECTION_PROPERTIES);
    JMSConnectionInfo connInfo = new JMSConnectionInfo(jmsProps);
    JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);
    ConnectionContext jmsContext = jmsService.createProducerConnectionContext(connInfo);
    return jmsContext;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) JMSConnectionInfo(org.apache.oozie.jms.JMSConnectionInfo) ConnectionContext(org.apache.oozie.jms.ConnectionContext) JMSAccessorService(org.apache.oozie.service.JMSAccessorService)

Aggregations

JMSAccessorService (org.apache.oozie.service.JMSAccessorService)3 Configuration (org.apache.hadoop.conf.Configuration)2 ConnectionContext (org.apache.oozie.jms.ConnectionContext)1 JMSConnectionInfo (org.apache.oozie.jms.JMSConnectionInfo)1