队列管理器和MQ中的队列之间的区别 [英] Difference between Queue Manager and Queue in MQ

查看:227
本文介绍了队列管理器和MQ中的队列之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看示例代码,看来我需要queue managerqueue name才能通过代码设置MQ.这些之间有什么区别,我可以从中获得这些价值?有什么建议吗?

Looking at the sample codes it seems I need queue manager and queue name to setup MQ through code. What is difference between those and where I can get those values from? Any suggestion?

MQTopicConnectionFactory cf = new MQTopicConnectionFactory();

  // Config
  cf.setHostName("localhost");
  cf.setPort(1414);
  cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
  cf.setQueueManager("QM_thinkpad");
  cf.setChannel("SYSTEM.DEF.SVRCONN");

  MQTopicConnection connection = (MQTopicConnection) cf.createTopicConnection();
  MQTopicSession session = (MQTopicSession) connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
  MQTopic topic = (MQTopic) session.createTopic("topic://foo");
  MQTopicPublisher publisher =  (MQTopicPublisher) session.createPublisher(topic);
  MQTopicSubscriber subscriber = (MQTopicSubscriber) session.createSubscriber(topic); 

推荐答案

您连接到可能承载许多不同队列的队列管理器.因此,是的,应用程序通常需要访问队列管理器,然后再访问该队列管理器上的特定队列.我建议您查看一下Stack Overflow 有关websphere-mq标签的信息,以帮助您入门.这些对象的名称应由您的应用程序设计师/开发人员知道,或者可以通过MQ管理员进行确认.

You connect to a queue manager which may host many different queues. So yes, an application generally needs access to a queue manager and then specific queues on that queue manager. I suggest you can look at the Stack Overflow info for the websphere-mq tag to help get you started. The names of those objects should be known by your application architect/developer or can be confirmed with the MQ admin.

这篇关于队列管理器和MQ中的队列之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆