com.ibm.msg.client.wmq.WMQConstants Java Examples

The following examples show how to use com.ibm.msg.client.wmq.WMQConstants. 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: FloodPublisher.java    From perf-harness with MIT License 6 votes vote down vote up
public void buildAMQPResources() throws Exception {
 	if (useJMS) {
 		// Use JMS to send messages to a topic.
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(JmsConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_BINDINGS);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, "PERF0");
jmsConnection = cf.createConnection();
jmsConnection.start();
Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic jmsTopic = jmsSession.createTopic(inboundTopic);
jmsProducer = jmsSession.createProducer(jmsTopic);
jmsMessage = jmsSession.createBytesMessage();
jmsMessage.writeBytes(message.getBytes());
 	}
 	else {
 		super.buildAMQPResources();
 	}
 }
 
Example #2
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 #3
Source File: IbmMqManager.java    From AuTe-Framework with Apache License 2.0 5 votes vote down vote up
IbmMqManager(String host, int port, String username, String password, String channel) throws JMSException {
    MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();
    connectionFactory.setHostName(host);
    connectionFactory.setPort(port);
    connectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);

    if(channel != null && !channel.isEmpty()) {
        connectionFactory.setChannel(channel);
    }

    connection = (QueueConnection) connectionFactory.createConnection(username, password);
    connection.start();
}
 
Example #4
Source File: WMB.java    From perf-harness with MIT License 3 votes vote down vote up
/**
 * Provide additional functionality for WMB connection factories.
 */
@SuppressWarnings("deprecation")
private void configureWBIMBConnectionFactory(MQConnectionFactory cf) throws JMSException {

		//Set common attributes i.e. version,port,hostname and buffersize.			
		//Set the broker version we will use version 2 is suitable for argo brokers
		cf.setBrokerVersion(brokerVersion);
		cf.setHostName(Config.parms.getString("jh"));
		cf.setPort(Config.parms.getInt("jp"));
		if (bufferSize > 0)
		{
			cf.setMaxBufferSize(bufferSize);
		}

		if (transport.equals("ip"))
		{
			System.out.println("Using transport type MQJMS_TP_DIRECT_TCPIP");
			cf.setTransportType(WMQConstants.WMQ_CM_DIRECT_TCPIP);
		}
		else if (transport.equals("ipmc"))
		{
			System.out.println("Using transport type MQJMS_TP_DIRECT_TCPIP, Multicast Enabled");
			cf.setTransportType(WMQConstants.WMQ_CM_DIRECT_TCPIP);
			cf.setMulticast(WMQConstants.RTT_MULTICAST_ENABLED);
		}
		else if (transport.equals("ipmcr"))
		{
			System.out.println("Using transport type MQJMS_TP_DIRECT_TCPIP, Multicast Enabled & Reliable");
			cf.setTransportType(WMQConstants.WMQ_CM_DIRECT_TCPIP);
			cf.setMulticast(WMQConstants.RTT_MULTICAST_RELIABLE);
		}
		else if (transport.equals("ipmcn"))
		{
			System.out.println("Using transport type MQJMS_TP_DIRECT_TCPIP, Multicast Enabled & NOT Reliable");
			cf.setTransportType(WMQConstants.WMQ_CM_DIRECT_TCPIP);
			cf.setMulticast(WMQConstants.RTT_MULTICAST_NOT_RELIABLE);
		}
		else if (transport.equals("mqb"))
		{
			//Place holder statement incase we ever need to do anything for this transport over and above what the MQ plugin already does.
			cf.setBrokerQueueManager(Config.parms.getString("jb"));
		}
		else if (transport.equals("mqc"))
		{
			//Place holder statement incase we ever need to do anything for this transport over and above what the MQ plugin already does.
			cf.setBrokerQueueManager(Config.parms.getString("jb"));
		}
		else
		{
			System.out.println("Invalid transport type");
			System.exit(1);
		}
		

}