Java Code Examples for com.ibm.mq.jms.MQConnectionFactory#setChannel()

The following examples show how to use com.ibm.mq.jms.MQConnectionFactory#setChannel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebSphereMQTarget.java    From jmet with MIT License 6 votes vote down vote up
public void init() throws InitException {

        try {
            MQConnectionFactory realfactory = new MQConnectionFactory();
            realfactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
            realfactory.setHostName(getHost());
            realfactory.setPort(getPort());
            realfactory.setQueueManager(getQueueManager());
            realfactory.setChannel(getChannel());

            factory = realfactory;
            connection = factory.createConnection(getUser(), getPassword());
            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            dest = (getDestType() == DestType.QUEUE) ? session.createQueue(getDestination()) : session.createTopic(getDestination());
            producer = session.createProducer(dest);
            connection.start();
        } catch (JMSException e) {
            throw new InitException(e.fillInStackTrace());
        }

    }
 
Example 2
Source File: MQCommandProcessor.java    From perf-harness with MIT License 5 votes vote down vote up
/**
 * Apply vendor-specific settings for building up a connection factory to
 * WMQ.
 * 
 * @param cf
 * @throws JMSException
 */
protected void configureMQConnectionFactory(MQConnectionFactory cf)
		throws JMSException {

	// always client bindings
	cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
	cf.setHostName(Config.parms.getString("cmd_jh"));
	cf.setPort(Config.parms.getInt("cmd_p"));
	cf.setChannel(Config.parms.getString("cmd_jc"));

	cf.setQueueManager(Config.parms.getString("cmd_jb"));

}