Advertisement
Guest User

Untitled

a guest
May 24th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. QueueBrowser browser = session.createBrowser(queue1);
  2.  
  3. queue1
  4.  
  5. public static void main(String[] args) throws Exception {
  6. Logger logger = LoggerFactory.getLogger(Connection.class);
  7. String hostname = "xxxxxx";
  8. int port = 1442;
  9. String queueManager = "xxxxxxxx";
  10. String channel = "xxxxxxxxxx";
  11. String queueName = "xxxxxxxxxx";
  12. String keystore = "xxxxxxxxx/xxxxxxx/ssclient_test.ks";
  13. String truststore = "cxxxxxx/xxxxxxxx/client_test.ts";
  14. String suiteName = "xxx_xxx_xxxx_xxx_xxx_xxx";
  15. String keyStorePassKey = "xxx_KEYSTORE";
  16. SSLSocketFactory sslSocketFactory = createSslSocketFactory(new File(keystore), new File(truststore),
  17. keyStorePassKey);
  18. MQXAQueueConnectionFactory mqConnFactory = new MQXAQueueConnectionFactory();
  19. mqConnFactory.setHostName(hostname);
  20. mqConnFactory.setPort(port);
  21. mqConnFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
  22. mqConnFactory.setQueueManager(queueManager);
  23. mqConnFactory.setChannel(channel);
  24. mqConnFactory.setUseConnectionPooling(true);
  25. mqConnFactory.setSSLSocketFactory(sslSocketFactory);
  26. mqConnFactory.setSSLCipherSuite(suiteName);
  27. QueueConnection queueConnection = mqConnFactory.createQueueConnection();
  28. QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
  29. queueSession.close();
  30. queueConnection.close();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement