use of com.ibm.mq.jms.MQQueueConnectionFactory in project pentaho-kettle by pentaho.
the class WebsphereMQProvider method getContext.
@Override
public JMSContext getContext(JmsDelegate meta, VariableSpace variableSpace) {
MQUrlResolver resolver = new MQUrlResolver(meta, variableSpace);
MQConnectionFactory connFactory = isQueue(meta, variableSpace) ? new MQQueueConnectionFactory() : new MQTopicConnectionFactory();
connFactory.setHostName(resolver.host);
try {
connFactory.setPort(resolver.port);
connFactory.setQueueManager(resolver.queueManager);
connFactory.setChannel(resolver.channel);
connFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
} catch (JMSException e) {
throw new RuntimeException(e);
}
return connFactory.createContext(variableSpace.environmentSubstitute(meta.ibmUsername), variableSpace.environmentSubstitute(meta.ibmPassword));
}
use of com.ibm.mq.jms.MQQueueConnectionFactory in project pentaho-kettle by pentaho.
the class WebsphereMQProvider method getContext.
@Override
public JMSContext getContext(JmsDelegate meta) {
MQUrlResolver resolver = new MQUrlResolver(meta);
MQConnectionFactory connFactory = isQueue(meta) ? new MQQueueConnectionFactory() : new MQTopicConnectionFactory();
connFactory.setHostName(resolver.host);
if (meta.sslEnabled) {
// try to configure SSL settings
try {
SSLContext sslContext = meta.sslUseDefaultContext ? SSLContext.getDefault() : getSslContext(meta);
SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
connFactory.setSSLFipsRequired(meta.ibmSslFipsRequired.toLowerCase().startsWith("t") || meta.ibmSslFipsRequired.toLowerCase().startsWith("y"));
connFactory.setSSLSocketFactory(sslSocketFactory);
connFactory.setSSLCipherSuite(meta.sslCipherSuite);
} catch (GeneralSecurityException | IOException e) {
throw new IllegalStateException(e);
}
}
try {
connFactory.setPort(resolver.port);
connFactory.setQueueManager(resolver.queueManager);
connFactory.setChannel(resolver.channel);
connFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
} catch (JMSException e) {
throw new IllegalStateException(e);
}
return connFactory.createContext(meta.ibmUsername, meta.ibmPassword);
}
Aggregations