WebSphere MQ 命令
IBMWebSphereMQ介绍安装以及配置服务详解

介绍安装以及配置服务详解IBM WebSphere MQ首先介绍一下MQMQ消息队列的简称是一种应用程序对应用程序的通信方法。
说白了也就是通过队列的方式来对应用程序进行数据通信。
而无需专用链接来链接它们。
MQ的通讯方式1.数据报的方式Datagram (Send and forget)应用程序在创建完消息后。
利用MQ的API将消息发送到队列中。
它充分利用了MQ(once and once only )2.请求和应答方式Request/Reply发送消息之后需等待对方处理结果。
需考虑如下问题:a.等待应答的时间是多少?b.如果没有应答怎么办。
c.本次session是否需要保留?MQ的开发流程1.让应用程序与队列管理器链接,通过MQconnect调用来进行此链接。
2.使用MQOpen调用为输出打开一个队列调用将其数据放到队列上。
MQPut应用程序使用 3.调用打开输入队列 4.调用MQOpen 5.使用MQGet从队列上接收数据安装步骤。
(此处为转载文章,作者已经证实所有步骤。
)Windows下WebSphere MQ服务端的安装:(1)把WebSphere MQWindows版服务器CD-ROM插入CD-ROM驱动器。
(2)如果安装了自动运行,那么会启动安装进程。
如果不启动,则双击CD-ROM 上的根目录中的Setup图标以启动安装程序。
(3)请等待,直到出现WebSphere MQ安装启动板窗口为止。
(4)如果需要更改安装的本地语言,单击选择语言图标,然后从列表中选择所需的语言。
(5)选择必备软件选项。
选择典型安装后,安装界面上的每个安装项右边有一个对钩号(表示已安装),反之则为一个叉号(表示还没有安装,如果要装MQ,则必须先把这些软件装好)。
如果出现了叉号:1)单击项目左边的?号以显示安装连接;2)选择要使用的安装源的选项,从以下各项选择:WebSphere MQ CD ?.因特网?网络? ?符号。
Websphere_MQ入门教程

Websphere MQ入门教程——使用IBM Websphere MQ提纲前言今天,大多数企业都希望他们的硬件和软件提供者不只受限于一家厂商,相反,大家普遍认为应当面向多家厂商能够运行多种软件的多种硬件平台,这些硬件平台既可以是大型机,也可以是笔记本计算机。
其中包括传统的中央集中式系统,通常指大型企业所采用的大型机,部门级小型计算机和个人用个人计算机或工作站。
通常这些平台是在“混乱”中发展起来的,当时它们的成长既有独立性又有偶然性。
混乱造成的结果是由企业“玻璃房子”控制的清静、秩序井然的世界退化成了一个个独立而分散的部门,并要求任务能够满足其独立而分散的需求。
有些公司一直在寻求一种成熟的策略,以便在企业范围内扩展应用和数据,使其距最终用户最近。
这种需求在设计时,存在许多限制,因为目前的交互式主要是同步形式,它要求对方一直处于通讯状态,这必然会大大增加网络代价。
目前,许多企业都是由一些相对于整体业务问题而孤立的解决方案所组成的自动化孤岛。
在信息共享的大环境下,如果能在这些孤岛之间架起桥梁,那么效率和利润都将得到提高。
从我们与不同行业客户与服务提供者广泛接触的经验来看,这种沟通非常必要,而且正变得越来越重要。
有些公司已经找到了连接网络若干个部分的解决方案,它们或者是自行开发的或者只有较窄的应用领域。
如IBM用户事务处理的CICS就有这样的连接功能,但数据处理软件的设计、维护和开发通常都非常昂贵。
因此需要一种通用软件,它能够集成多个运行于供应商所提供的系统上的应用程序。
这种软件不仅成本不高,而且可以可靠地处理很高的吞吐量,消息中间件正是解决这种互连问题的解决方案。
商业消息中间件的出现保证了消息传输的可靠性,高效率和安全性,同时也减少了系统的开发周期。
目前应用最多的消息中间件产品为IBM Websphere MQ。
本文就针对Websphere MQ的体系结构、管理和开发进行详细的阐述,希望对读者有所帮助。
WebSphere MQ快速指南说明书

Quick Guide of the Administrative Console from WebSphere ApplicationServer for WebSphere MQ usersIBM Techdoc: 7018556h t t p://w w w.i b m.c o m/s u p p o r t/d o c v i e w.w s s?u i d=s w g2*******Date last updated: 07-Mar-2018Angel Rivera –r i v e r a@u s.i b m.c o mIBM WebSphere MQ Support+++ Objective +++The objective of this techdoc is to provide a quick guide of the sections of the Admin-istrative Console from WebSphere Application Server which are relevant to Web-Sphere MQ users:- Listener Ports- JMS resources (Connection Factories, Destinations, Activation Specifications)- MDBs and their mapping to Listener Port or Activation Specification- Environment variables (MQ_INSTALL_ROOT for WebSphere Application Server V6)- Trace enablement and specification of the trace string- Specification for the MQ Native Libraries for Bindings Transport Type- Enablement of new MQ V7 functions: Read Ahead, Asynchronous Put- Additions in WAS V8: connection name list, advanced propertiesThe screen shots are taken from a WebSphere Application Server Administrative Con-sole at V7.Whenever relevant, specific screen shots from WebSphere Application Server V6 and V8.x and V9 will be shown.+++ Update on 07-Mar-2018:New section for the MQ Resource Adapter properties, such as: reconnectionRetryInterval+++ Update on 10-Aug-2016:Including WAS V9.+++ Update on 18-Nov-2011:Including WAS V8.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ High level view of the Console, regarding functions related to MQ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This is the high level view of the WebSphere Application Server Administrative Con-sole showing the menus that have objects related to MQ.The default URL for the WebSphere Application Server Administrative Console is:h t t p://h o s t n a m e.d o m a i n.c o m:9060/i b m/c o n s o l eServers:Listener Ports: start, stop, statusApplications:MDBs: start, stop, bindings to Listener Port or to Activation Specification Resources:JMS Resources:Connection FactoriesDestinations (Queues, Topics)Activation SpecificationsMQ Resource Adapter properties (such as reconnectionRetryInterval) Environment:WebSphere Application Server V6: MQ_INSTALL_ROOT Troubleshooting:Tracing: trace string, enable tracing, disable tracing.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Listener Ports++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ A WebSphere Application Server Listener Port is not a JMS administrative object and thus, it is not stored in the JNDI directory service.Rather, it is an object under the "server" of WebSphere Application Server.The short cut is:Application servers > server1 > Message listener service > Listener PortsThe full procedure is described below.From the left panel, select:Servers > Server Types > WebSphere application serversFrom the right panel, click on the appropriate server, in this case, “server1”.The Configuration tab will display the main information on the server:You need to scroll down to reach the section “Communications”Click on “Messaging”Click on “Message listener service”In the “Message listener service”, click on: Listener Ports Click on Listener Ports++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ JMS resources (Connection Factories, Destinations, Activation Specifications)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The JMS resources are:- Connection Factories (Generic, Queue and Topic)- Destinations (Queues, Topics)- Activation SpecificationsNotice that MQ is designated as the "WebSphere MQ messaging provider".The "Default messaging provider" is NOT MQ, but rather, the System Integration Bus (SIB).++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ JMS resources (JMS providers > MQ Resource Adapter properties)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ New in WAS 8:WebSphere Application Server V8 exposes the following WebSphere MQconnection properties that are used to configure the WebSphere MQ resource adapter that is used by the WebSphere MQ messaging provider. These properties affect the connection pool that is used by activation specifications:- maxConnections- connectionConcurrency- reconnectionRetryCount- reconnectionRetryIntervalh t t p s://w w w.i b m.c o m/s u p p o r t/k n o w l e d g e c e n t e r/S S E Q T P_9.0.0/c o m.i b m.w e b s p h e r e .b a s e.d o c/a e/t m m_w m q r a_p r o p c o n f i g.h t m lWebSphere Application Server traditional 9.0.0.x > Managing messaging with the IBM MQ messaging providerConfiguring properties for the IBM MQ resource adapter.+ begin excerpt.You can configure the IBM MQ resource adapter properties that affect the connection pool, which is used by IBM MQ messaging provider activation specifications.About this taskThere are properties that are used to configure the IBM MQ resource adapter used by the IBM MQ messaging provider:- maxConnections: default 50- connectionConcurrency: default 1(Setting this property only affects WebSphere® Application Server 7 nodes.The property has no effect for WebSphere Application Server Version 8 or later nodes.)- reconnectionRetryCount: default 5- reconnectionRetryInterval: default 300,000 milliseconds (it is 5 minutes!!)- startupRetryCount- startupRetryInterval.These properties affect the connection pool, which is used by the IBM MQ messaging provider activation specifications. They do not affect the IBM MQ messaging provider queues, topics, or connection factories..Procedure.1. In the navigation pane, click Resources > JMS-> JMS providers to display a list of JMS providers in the content pane.2. Optional: If you want to manage JMS resources that are defined at a different scope setting, change the Scope setting to the required level.3. In the Providers column of the displayed list of JMS providers, click the name of the IBM MQ messaging provider that you want to work with.4. In the content pane under Additional properties, click Resource adapter properties to view the configuration page for the properties.5. Specify the required values for the properties..+ end excerptExample:JMS Resources > JMS providersJMS Resources > JMS providers > WebSphere MQ messaging providerJMS Resources > JMS providers > WebSphere MQ messaging provider > Resource Adapter properties++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ MDBs and their mapping to Listener Port or Activation Specification++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ A Message Driven Bean (MDB) is part of a deployed application.They can be found under:Applications > Application Types > WebSphere enterprise applicationsNotice that the application needs to be shown with a status of running (green arrow) in order for the corresponding MDB to be running.The MDB can be associated with a Listener Port or an Activation Specification. From the sample above, click on the application "SampleMDBEJBEAR".Under the section "Enterprise Java Bean Properties", select:Message Driven Bean listener bindingsIn this example, the binding is with a Listener Port++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Environment variables (MQ_INSTALL_ROOT for WebSphere Application Server V6) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++In WebSphere Application Server V6, the WebSphere Application Server environment variable MQ_INSTALL_ROOT is used to indicate the location of the MQ JMS jar files.The default value of MQ_INSTALL_ROOT is:${WAS_INSTALL_ROOT}/lib/WMQWhere WAS_INSTALL_ROOT is:AIX: /usr/IBM/WebSphere/AppServerOthers: /opt/IBM/WebSphere/AppServerWindows: C:\Program Files\IBM\WebSphere\AppServerThe jar files are located in ${MQ_INSTALL_ROOT}/java/libThus, the full path for these MQ jar files is:AIX: /usr/IBM/WebSphere/AppServer/lib/WMQ/java/libOthers: /opt/IBM/WebSphere/AppServer/lib/WMQ/java/libWindows: C:\Program Files\IBM\WebSphere\AppServer\lib\WMQ\java\libIn WebSphere Application Server V7, the variable MQ_INSTALL_ROOT is practically not used. For more details, consult the following techdoc:h t t p://w w w.i b m.c o m/s u p p o r t/d o c v i e w.w s s?u i d=s w g2*******WebSphere MQ V5.3, V6 and V7 as JMS Provider for WebSphere Application Server V5, V6.0, V6.1 and V7In WebSphere Application Server 6.0, the following variable is defined in terms of MQ_INSTALL_ROOT.Do NOT modify directly this variable:MQJMS_LIB_ROOT = ${MQ_INSTALL_ROOT}/lib/WMQIn WebSphere Application Server V6.1 the variable MQJMS_LIB_ROOT is NO longer used.It is still shown in the WebSphere Application Server Administration Console, but its value is NOT used. Instead, the following is actually used:${MQ_INSTALL_ROOT}/lib/WMQTo find out the values for these variables, use the WebSphere Application Server ad-ministrative console:Environment > WebSphere VariablesEnsure to select the scope to: Node=server1You will need to scroll down or go to the next page in the long list of variables, until you find:MQ_INSTALL_ROOT ${WAS_INSTALL_ROOT}/lib/WMQ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Trace enablement and specification of the trace string++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The following technote has the details on how to enable the MQ JMS trace in WAS:h t t p://w w w.i b m.c o m/s u p p o r t/d o c v i e w.w s s?u i d=s w g2*******Technote: 1199176Enabling Java Message Service (JMS) trace for WebSphere Application ServerWAS V9.0 (all on one line):*=info:jmsApi=all:Messaging=all:com.ibm.mq.*=all:JMSApi=all:com.ibm.ws.cdi.jms*=all WAS V8: The string should be:*=info: JMSApi=all: Messaging=all: com.ibm.mq.*=allWebSphere Application Server V6 and V7: The string should be (in one single line)*=info:JMSApi=all:JMSServer=all:Messaging=all:JMS_WASTraceAdapter=all:com.ibm.mq.*=all:jmsApi=all Select: Troubleshooting -> Logs and Trace.- For WAS V6, V7, V8 and V9 (using old style and not using new HPEL) go to page 14. - For WAS V8 (using new HPEL) to go page 17.For WAS V6, V7, V8 and V9 (Legacy, NOT using HPEL):Select: Diagnostic TraceTo ensure you capture full data flows, select: Trace Output Format = AdvancedThen select:Change Log Details LevelsSpecify the string (all in one single line):WAS V9.0 (all on one line):*=info:jmsApi=all:Messaging=all:com.ibm.mq.*=all:JMSApi=all:com.ibm.ws.cdi.jms*=all WAS V8:*=info: JMSApi=all: Messaging=all: com.ibm.mq.*=allWAS V6 and V7:*=info:JMSApi=all:JMSServer=all:Messaging=all:JMS_WASTraceAdapter=all:com.ibm.mq.*=all:jmsApi=all Location of trace files<WAS_HOME>\profiles\<server_name>\logs\<server_name>\trace.logTo disable the trace in WebSphere Application Server:After you have finished collecting the trace, please disable the tracing to avoid un-necessary consumption of system resources and disk spaceChange Log Detail Levels:*=infoFor WAS V8 and later (using the new HPEL): Select: Configure HPEL traceSelect: Change log detail levelsSpecify the string (all in one single line):WAS V9.0 (all on one line):*=info:jmsApi=all:Messaging=all:com.ibm.mq.*=all:JMSApi=all:com.ibm.ws.cdi.jms*=all WAS V8:*=info: JMSApi=all: Messaging=all: com.ibm.mq.*=allLocation of trace files:<WAS_HOME>\profiles\<server_name>\logs\<server_name>\tracedata\*To disable the trace in WebSphere Application Server do the following:After you have finished collecting the trace, please disable the tracing to avoid un-necessary consumption of system resources and disk spaceChange Log Detail Levels:*=info++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Specification for the MQ Native Libraries for Bindings Transport Type++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ In order to locate the WebSphere MQ V7 or later native libraries required for BIND-INGS mode, the application server needs to be configured to have the generic Java Virtual Machine (JVM) argument set to the location of the libraries.-Djava.libary.pathFor information about where these files are installed, please see the "The Java Native Interface (JNI) libraries required by WebSphere MQ classes for JMS applications" sec-tion in the online manual for MQ/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.dev.doc /q031570_.htmThe Java Native Interface (JNI) libraries required by IBM MQ classes for JMS applica-tions+++ WebSphere Application Server 6From the WebSphere Application Server V6 Admin Console:Click on Servers > Application Servers > server1.Then, under “Server Infrastructure”,click Java and Process Management > Process definitionThen select “Java Virtual Machine”Under “Generic JVM arguments”, enter:-Djava.library.path=library_path For Linux 32-bit, it should be:-Djava.library.path=/opt/mqm/java/libFor Linux 64-bit, HP-UX and Solaris, the string is:-Djava.library.path=/opt/mqm/java/lib:/opt/mqm/java/lib64 For AIX, the string is:-Djava.library.path=/usr/mqm/java/lib:/usr/mqm/java/lib64+++ WebSphere Application Server V7 or laterIt is required for bindings mode applications that the JMS runtime must access the appropriate "bindings module" in the "native" WMQ libraries.Thus the Resource Adapter's "native library path" must be configured to point to the WMQ directory where these libraries are located:AIX: /usr/mqm/java/libUnix: /opt/mqm/java/libWindows: C:\Program Files\IBM\WebSphere MQ\java\libFor more information see the following web page from the WebSphere Application Server online manual:/support/knowledgecenter/SSEQTP_7.0.0/com.ibm.websphere. base.doc/info/aes/ae/tmj_adm33.htmlConfiguring the WebSphere MQ messaging provider with native libraries informationThe procedure is:- In the navigation pane, expand Resources > JMS > JMS providers- Select the WebSphere MQ messaging provider that is at the correct Scope for the connection factory or activation specification that will create the bindings mode con-nection. Note that native path information at Server scope is used in preference to native path information at higher scopes, and native path information at Node scope is used in preference to native path information at Cell scope.- Under General Properties, in the Native library path property, enter the full name of the directory that contains the WebSphere MQ native libraries.For example, on Linux enter /opt/mqm/java/lib. Enter only one directory name. Click OK.- Save any changes to the master configuration.- If you are running in an application server environment, you must restart all affect-ed servers twice when you have changed the native path information. Otherwise, a WMSG1623E message is produced, indicating that the WebSphere MQ messaging pro-vider is not available.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Enablement of new MQ V7 functions: Read Ahead, Asynchronous Put++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ These functions are ONLY available in WebSphere Application Server V7 and later. Read AheadResources > JMS > Queues > $QueueName/$TopicName > Advanced properties Section: OptimizationsYou will see the Advanced Properties:You will need to scroll down.Section: OptimizationsRead ahead, and cache, non-persistent messages for consumers As per queue definitionYesNoRead ahead consumer close methodWait for all cached messages to be deliveredWait for the current message to be deliveredAsynchronous put ("fire and forget")Resources > JMS > Queues > $QueueName/$TopicName > Advanced properties Section: OptimizationsSee previous page for the "Advanced Properties".Asynchronously send messages to the queue managerAs per queue definitionYesNo++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Additions in WAS V8 and later: connection name list, advanced properties++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ These functions are ONLY available in WebSphere Application Server V8 and later.+ Support for WMQ connection name list in a Connection Factory (CF) or an Activation Specification (AS).During the creation of any of these objects:Notice the new radio button to choose between a single host/port or a connection name list+ Exposing additional WMQ propertiesSeveral existing WMQ properties that were previously set via custom properties are now available in the WAS Administrative Console.Queue connection factories: Client reconnectClient reconnect options (Disabled)Client reconnect timeout (1,800 seconds)Queues, Advanced properties:Message Body: Unspecified, JMS, MQReply to style: Default, MQMD, RFH2Queues, Advanced properties: Message descriptor:MQMD read enabledMQMD write enabled+++ end +++。
IBM WebSphere MQ 8.0 快速入门指南说明书

IBM WebSphere MQVersion 8.0Quick Start GuideUse this guide to get started with IBM WebSphere MQ Version 8.0.National Language Version:To obtain the Quick Start Guide in other languages,print the language-specific PDF from the Quick Start DVD.Product overviewWebSphere ®MQ provides a universal messaging backbone with robust connectivity for flexible and reliable messaging for applications,and integration of existing IT assets that use a service-oriented architecture (SOA).WebSphere MQ supports application portability through its message queuing interface (MQI),which is a consistent application programming interface available across all the supported platforms.WebSphere MQ also supports the Java ™Message Service (JMS)application programming interface,and both queue-based and publish/subscribe messaging.Managed File Transfer extends your WebSphere MQ messaging network to support file-based integration,and a range of security features is available to protect both the messaging system and the messages that pass through it.You can use the WebSphere MQ Explorer graphical user interface to administer and configure the entire WebSphere MQ network.Product documentation for all versions of WebSphere MQ is available at /software/integration/wmq/library/.Specifically,the WebSphere MQ Version 8.0product documentation is also available in IBM Knowledge Center (/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.helphome.v80.doc/WelcomePagev8r0.htm).You can also download the WebSphere MQ Version 8.0product documentation as a series of PDF files from ftp:///software/integration/wmq/docs/V8.0/PDFs.Service and support information is provided in the documentation.Information about how to use WebSphere MQ Explorer can be accessed either from within WebSphere MQ Explorer or in the product documentation.WebSphere MQ architectures range from simple architectures that use a single queue manager,to more complex networks of interconnected queue managers.For more information about planning your WebSphere MQ architecture,see the Planning (/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.pla.doc/q004690_.htm)section of the product documentation.For installation instructions for WebSphere MQ on AIX,HP-UX,Linux,Solaris,IBM i,or Microsoft Windows,and fordetails of the hardware and software configurations that are required,see the Installing(/support/ knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ins.doc/q008250_.htm)section of the product documentation.For installation instructions for WebSphere MQ on z/OS®,and for details of the hardware and software configurations that are required,see the Installing WebSphere MQ for z/OS(/support/knowledgecenter/SSFKSJ_8.0.0/ com.ibm.mq.ins.doc/q009640_.htm)section of the product documentation.Further scenarios help you to configure or use product features by taking you through the appropriate task steps.The scenarios include links to other content that helps you to gain a better understanding of the area in which you areinterested.More informationFor more information about WebSphere MQ,see the following resources:Product readme fileThe product readme file(readme.html)is included on the product media and is installed when you installproduct components.The latest version is available on the product readmes web page(/support/docview.wss?rs=171&uid=swg27006097).IBM Support PortalSupport information available through IBM Support Portal includes the following resources:v Support technotes(/support/search.wss?q=websphere+mq)v Available downloads and other resources(/support/entry/portal/product/websphere/websphere_mq?productContext=24824631)v Social Media channels for WebSphere and CICS®Support(/support/docview.wss?uid=swg21410956#2IBM WebSphere MQ Version8.0Licensed Materials-Property of IBM.©Copyright IBM Corp.2006,ernment Users Restricted Rights-Use,duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.IBM,the IBM logo,®,AIX,CICS,Passport Advantage,WebSphere and z/OS are trademarks or registered trademarks of International Business Machines Corp.,registered in many jurisdictions worldwide.Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.Linux is a registered trademark of Linus Torvalds in the United States,other countries,or both.Microsoft,Windows,and the Windows logo are trademarks of Microsoft Corporation in the United States,other countries,or both.Other product and service names might be trademarks of IBM or other companies.A current list of IBM trademarks is available on the Web at“Copyright and trademark information”(/legal/copytrade.shtml).Part Number:CF4BZMLPrinted in Ireland。
IBM WebSphere MQ常用命令

endmqm –i QmgrNa me 立即 停止
endmqm –p QmgrNa me 强制 停止 显示队列 管理器
dspmq – m QmgrNa me
运行 MQSeries 命令
runmqsc QmgrNa me
如果是默 认队列管 理器,可 以不带其 名字
DEFINE QMODEL (QNAM E) DEFTYP E (TEMPD YN) 定义本地 传 DE输FI队NE列 QLOCAL( QTNAME ) USAGE(X MITQ) DEFPSIS T(YES) +
INITQ (SYSTE M.CHAN NEL.INIT Q)+
PROCES S(PROCE SSNAME) REPLAC E
创建进程 定义
DEFINE PROCES S (PRONA ME) +
DESCR (‘ STRING ’)+
APPLTYP E (WINDO WSNT) +
APPLICID (’ runmqchl -c SDR_TE ST -m QM_ TEST’)
其中 APPLTYP E的值可 以是: CICS、 UNIX、 WINDOW S、 WINDOW SNT等
清除队列 中的所有 消息
CLEAR QLOCAL (QNAM E)
常用补充 命令 显示队列 管理器 dspmq 显示文件 名 dspmqfls
启动本地 队列管理 器 strmqm
结束本地 队列管理 器 endmqm
启动通道 启动进程 runmqchi/ runmqchl
ibmwebspheremq常用命令常用命令创建队列管理器crtmqmqmgrnameq是指创建缺省的队列管理器删除队列管理器dltmqmqmgrname启动队列管理器strmqmqmgrname如果是启动默认的队列管理器可以不带其名字停止队列管理器endmqmqmgrname受控停止endmqmqmgrname立即停止endmqmqmgrname强制停止显示队列管理器dspmqqmgrname运行mqseries命令runmqscqmgrname如果是默认队列管理器可以不带其名字往队列中放消息amqsputqnameqmgrname如果队列是默认队列管理器中的队列可以不带其队列管理器的名字从队列中取出消息amqsgetqnameqmgrname如果队列是默认队列管理器中的队列可以不带其队列管理器的名字启动通道runmqchlqmgrname启动侦听runmqlsrqmgrname停止侦听endmqlsrqmgrnamemqseries命令定义死信队列defineqlocalqnamedefpsistyesreplace设定队列管理器的死信队列alterqmgrdeadqqname定义本地队列defineqlqnamereplace定义别名队列defineqaliasqaliasnametargqqname远程队列定义defineqremoteqrnamernameaaarqmnameqmgrnamexmitqqtname定义模型队列defineqmodelqnamedeftypetempdyn定义本地传输队列defineqlocalqtnameusagexmitqdefpsistyesinitqsystemchannelinitqprocessprocessnamereplace创建进程定义defineprocesspronamedescrstringappltypewindowsntapplicidrunmqchlqmtest其中appltype的值可以是
IBMWEBSPHEREMQ客户端--服务器端安装配置

一:安装1,使用虚拟光驱加载,运行setup.ext2,进入安装主页面3,进入软件需求,一般第一次安装的时候第二项的eclipse会显示未安装,单击eclipse前面的“+”,在选从cd-rom安装,安装完后进入网络配置项4,网络配置,选否,直接进入websphereMQ安装项一直下一步到安装类型界面注意此时一般选择定制,可选择安装路径及安装的组件下一步路径根据需要自行设定6,下一步到功能组件界面如果需要安装服务器则windows客户机可以不选,其他选项最好全选,不用考虑太多建议:可将服务器,客户机资源管理器java消息传递和soap transport还有开发工具全部选中,日后无论做客户机还是服务器就不需要有所改动了如下图7,然后开始安装,耗时较长8,安装完成后会进入配置界面,一般都默认下一步,但是在网络配置那一项时选择否,其他的全都是默认不要在进行任何改动,9,快完成时会遇到缺省设置,一般无需设置,当安装配置完毕后进入资源管理器中自行设置,所以不点击缺省设置,直接单击下一步直至完成即可。
二.服务器—客户端配置首先设置服务器1,可根据资源管理器中的帮助文档进行配置2,帮助—〉帮助内容—〉webspheremq 帮助中心—〉webspheremq教程3,如果只需要配置客户端—服务器端的话按照如下步骤1新建一个队列管理器2在此队列管理器下新建一个本地队列(仅仅是本地队列,输入队列名称直接点击完成即可)3在高级选项里面的通道,新建一个服务器连接通道,输入通道名后下一步,选择MCA 项在mca用户标识中输入MUSR_MQADMIN即可,单击完成此时便配置好了服务器客户端配置客户端无需进行配置只需要安装mq的客户机便可,其实不用安装也可以实现同服务器的通讯客户端与服务器所谓客户端就是任何一个终端可以通过服务器端的ip地址将消息写入服务器的队列或是读取服务器端中队列的消息,所有的消息都存储在服务器端,客户端可以不用安装mq,通过程序可以直接与服务器建立连接,例如下面这段代码:import com.ibm.mq.*;public class Client {/*** @param args*/@SuppressWarnings("unchecked")public static void main(String[] args) {// TODO Auto-generated method stubString hostName = "192.168.1.4" ;String channel = "HH" ;String qManager = "QM_APPLE" ;String qName = "Q1" ;/**//*设置MQEnvironment 属性以便客户机连接*/MQEnvironment.hostname = hostName ;MQEnvironment.channel = channel ;SID = 1381;MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);/**//*连接到队列管理器*/try {MQQueueManager qMgr = new MQQueueManager(qManager);int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |MQC.MQOO_OUTPUT;MQQueue system_default_local_queue = qMgr.accessQueue(qName, openOptions);//与队列连接MQMessage hello_world = new MQMessage();hello_world.writeUTF("Hello World");MQPutMessageOptions pmo = new MQPutMessageOptions();system_default_local_queue.put(hello_world,pmo);//将消息放入队列中// MQMessage receiveMsg = new MQMessage();// receiveMsg.messageId = hello_world.messageId;// MQGetMessageOptions gmo = new MQGetMessageOptions();// system_default_local_queue.get(receiveMsg,gmo);// String msgText = receiveMsg.readUTF();// System.out.println("the message is: " + msgText);// qMgr.disconnect();} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();System.out.println(e);}}}客户端不用安装mq也可实现读写信息。
IBMWebSphereMQ安装及配置详解

IBMWebSphereMQ安装及配置详解1. 打开MQ安装程序,选择下⼀步,默认安装WebSphere MQ,2. 完成MQ的安装⼯作,启动WebSphere MQ,3. 服务器配置,选择新建队列管理器,创建名为 "mq"的队列管理器,其他选项默认不变,点"下⼀步"4. 允许在 TCP/IP上进⾏队列管理器的远程管理,点击"下⼀步",完成MQ队列管理器的创建。
5. 新建本地队列,在mq下创建名为"MQ_send"的本地队列(⽤户可以根据⾃⼰的需求更改本地队列的名字和数量),其他选项默认即可。
6. 在 mq下创建名为"MQ_CHL"的服务器通道,其他选项默认即可。
7. 在MQ服务器端的计算机⽤户中添加MQ客户端所在计算机的系统⽤户。
例如:我的MQ客户端所在的计算机⽤户名为Administrator,则在服务器端系统中添加名为"Administrator"的⽤户。
具体步骤如下:<1>点击"开始"->"控制⾯板"->"管理⼯具"->"计算机管理"->"本地⽤户和组"->"⽤户",选择Administrator点右键,打开属性⾯板,选择“⾪属于”把mqmt添加进去。
如下图所⽰:(如果客户端计算机使⽤的其他的⽤户名,在服务器端新建⼀个⽤户名,同样操作,把⽤户名添加⾪属于mqm组⾥⾯)注意:1. 客户端连接MQ服务出现2035错误MQRC_NOT_AUTHORIZED2.找到mq的安装⽬录下的bin⽬录,在cmd环境下执⾏命令runmqsc 然后执⾏命令 alter qmgr chlauth(disabled) 把权限验证下掉就可以了,如下图所⽰:3. MQ常⽤命令:登录MQI,⼀般是cd到MQ安装⽬录下bin,然后切换mqm账户,mqm账户是mq默认的管理员账户。
WebSphere MQ_常用命令

1. 创建队列管理器crtmqm -q QMA(-q表示QMA为默认队列管理器)2. 启动队列管理器strmqm QMA(对于默认队列管理器,则为strmqm )3. 启动管理器平台runmqsc QMA4. 定义本地队列define qlocal(queueA)若用于队列管理器之间进行通信,这应为define qlocal(queue1) usage(xmitq)5. 定义远程队列define qremote(queue.remote) rname(apple.queue) rqmname('queueB') xmitq(queue1)(apple.queue为远程队列管理器queueB中的本地队列)6. 定义发送端通道define channel(queueA.queueB) chltype(sdr) conname('192.168.1.90(1414)') xmitq(queueA) trptype(tcp)7. 定义接受方通道define channel(queueA.queueB) chltype(rcvr) trptype(tcp)8. 更改侦听端端口号alter listener(system.default.listener.tcp) trptype(tcp) port(1415)9. 启动侦听start listener(system.default.listener.tcp)在命令行c:\runmqlsr10. 列出侦听状态display lsstatus(*)11. 测试,向队列中放入消息amqsput queue_name queue_manager_name从队列中取出消息amqsget queue_name queue_manager_name12. 在服务器方建立用于客户方链接的通道define channel(channel2) chltype(svrconn) trptype(tcp) mcauser(' ')13. 在客户机方,使用MQSERVER定义客户机链接通道(如使用了Active Directory 服务支持,则可略过本步骤)SET MQSERVER=CHANNEL1/TCP/192.168.1.90(1414) //Windowsexport MQSERVER=’CHANNEL1/TCP/server-hostname(port)’ //linux15. 测试,向队列中放入消息amqsputc queue_name queue_manager_name从队列中取出消息amqsgetc queue_name queue_manager_name16. 关闭队列管理器endmqm mqm_nameendmqm -i mqm_name17. 结束所有侦听进程endmqlsr -m mqm_name18. 查看WebSphere MQ版本号dspmqver19. 查看已有的MQ管理器dspmq20. 启动WebSphere MQ Explorerstrmqcfg21. "dspmqfls" command to convert between real and transformed object names.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
附录WebSphere MQ 命令一览表队列管理器(Queue Manager)crtmqm 创建队列管理器(Create Queue Manager)[-c Text] 描述,最多64 个字符[-d DefaultTransmissionQueue] 缺省传输队列[-h MaximumHandleLimit] 一个应用程序可以MQOPEN 的最大句柄数min=1,max=999,999,999,default=256[-lc | -ll] Log 类型-lc Circular Logging,环型日志-ll Linear Logging,线型日志[-ld LogPath] Log 文件的目录,mqm 用户必须有访问权限,缺省为:Windows X:\Program Files\IBM\WebSphere MQ\log\qmgrUNIX /var/mqm/log[-lf LogFileSize] Log 文件大小,4KB 的倍数.Windows min=32,max=16,384,default=256 (1 MB)UNIX min=64,max=16,384,default=1024 (4 MB)[-lp LogPrimaryFiles] 主Log 文件数量,min=2,max=62,default=3[-ls LogSecondaryFiles] 备用Log 文件数量,min=1,max=61,default=2 注意:LogPrimaryFiles + LogSecondaryFiles <= 63[-q] 缺省队列管理器[-g ApplicationGroup] 应用组。
Application Group 中的用户可以运行MQI 应用,更新IPCC 资源,改变Queue Manager 目录中的内容。
仅对WMQ for AIX,Solaris,HPUX,Linux 有效。
会反映到qm.ini 中。
mqm 必须是Application Group 中的用户。
缺省-g all[-t IntervalValue] min=0,max=999,999,999,default=999,999,999,单位: 毫秒。
触发间隔(Trigger Time Interval)[-u DeadLetterQueue] 死信队列(Dead Letter Queue))[-x MaximumUncommittedMessages] 最大的未提交的消息数量min=1,max=999,999,999,default=10,000在一个交易中的消息最大数量,为MQPUT + MQGET + LUW 中产生的Trigger Message 数量之和[-z] 抑止出错信息QMgrName 队列管理器名例:crtmqm -t 5000 -u SYSTEM.DEAD.LETTER.QUEUE -ll QMdltmqm 删除队列管理器(Delete Queue Manager)[-z] 抑止出错信息QMgrName 队列管理器名例:dltmqm -z QMstrmqm 启动队列管理器(Start Queue Manager)[-c] 启动队列管理器,覆盖重建所有的系统对象,再停止该队列管理器[-z] 抑止出错信息[QMgrName] 缺省为系统的缺省队列管理器例:strmqm -c QMendmqm 停止队列管理器(End Queue Manager)[-c | -w | -i | -p]-c Controlled (or quiesced) shutdown。
缺省值。
等到所有的应用MQDISC,Queue Manager 停止,当即显示命令提交的提示。
-w Wait shutdown与-c 效果相同,只是命令提示一直等到Queue Manager 停止后才出来。
-i Immediate shutdown等到当前的所有MQ API 都执行完毕,Queue Manager 停止。
以后的MQ API 全都失败,当前的交易在下次重启后自动回滚。
提示等到Queue Manager 停止后出现.-p Preemptive shutdown。
强制停止。
不会等待MQDISC 或MQ API 执行完毕,所以队列可能会出现异常。
提示等到Queue Manager 停止后出现。
[-z] 抑止出错信息QMgrName 队列管理器名例:endmqm -c QMendmqm -i QMdspmq 显示队列管理器(Display Queue Manager)[-m QMgrName] 缺省为系统的缺省队列管理器[-s] 显示运行状态例:dspmqQMNAME(QM) STATUS(正在运行)QMNAME(QM1) STATUS(正常结束)QMNAME(QM2) STATUS(正常结束)dspmq -s -m QMQMNAME(QM) STATUS(正在运行)命令服务器(Command Server)strmqcsv 启动命令服务器(Start Command Server)[QMgrName] 缺省为系统的缺省队列管理器例:strmqcsv QMendmqcsv 停止命令服务器(End Command Server)[-c | -i]-c Controlled,允许已经开始处理的Command 消息完成。
缺省值-i Immediately,中止正在处理的Command 任务QMgrName 队列管理器例:endmqcsv QMendmqcsv -i QMdspmqcsv 显示命令服务器(Display Command Server)[QMgrName] 缺省为系统的缺省队列管理器返回的Command Server 状态可能是:l Startingl Runningl Running with MAND.QUEUE not enabled for getsl Endingl Stopped例:dspmqcsv QMListener (监听器)runmqlsr 运行监听器(Run Listener)-t tcp[-p Port] Port 口,缺省为1414[-i IPAddr] IP 地址,如果不指定,Listener 会监听所有的IP 地址[-b Backlog] 允许的并发连接请求数-t lu62-n TpName 交易名,如果不指定,从Queue Manager 的配置中取-t netbios-a Adapter NetBIOS Adapter Number。
缺省为0-l LocalName NetBIOS Local Name。
缺省从队列管理器的配置中取-e Names Listener 可用的Name 数量。
缺省从队列管理器的配置中取-s Sessions Listener 可用的Session 数量。
缺省从队列管理器的配置中取-o Commands Listener 可用的Command 数量。
缺省从队列管理器的配置中取-t spx-x Socket 缺省为0x5E86-b Backlog 允许的并发连接请求数-t udp[-p Port] Port 口,缺省为1414[-m QMgrName]缺省为系统的缺省队列管理器备注:-t 为必选项,其它为可选项例:runmqlsr -t tcp -p 1414 -m QMendmqlsr 停止监听器(End Listener)[-w] 等到命令完成后才返回控制[-m QMgrName] 缺省为系统的缺省队列管理器触发监控器(Trigger Monitor)runmqtmc 启动Client 端触发监控器(Run Trigger Monitor for Client) [-m QMgrName] 缺省为系统的缺省队列管理器[-q InitiationQName] 初始化队列名字,缺省为SYSTEM.DEFAULT.INITIATION.QUEUErunmqtrm 启动Server 端触发监控器(Run Trigger Monitor for Server) [-m QMgrName] 缺省为系统的缺省队列管理器[-q InitiationQName] 初始化队列名字,缺省为SYSTEM.DEFAULT.INITIATION.QUEUETracestrmqtrc 启动Trace (Start Trace,Windows 平台)[-t TraceType][-x TraceType][-l MaxSize]解释同后strmqtrc 启动Trace (Start Trace,HP-UX,Solaris,Linux 平台) [-m QMgrName] 缺省为系统的缺省队列管理器[-e] Early Tracing。
可以Trace 队列管理器的创建与启动.[-t TraceType] Trace 的部分,可以有多个-t 选项[-x TraceType] 不要Trace 的部分,可以有多个-x 选项TraceType 可以是以下的组合:all 全部,是以下全部选项的叠加api MQI 调用和主要队列管理器部件相关信息commentary 部件中的评注信息comms 网络通信上的数据流csdata 通用服务的内部数据csflows 通用服务的控制过程detail 控制过程的细节数据lqmdata 本地队列管理器的内部数据lqmflows 本地队列管理器的控制过程otherdata 其它部件的内容数据otherflows 其它部件的控制过程parms 激活trace 控制过程remotedata 通信部件的内部数据remoteflows 通信部件的控制过程servicedata 服务部件的内部数据serviceflows 服务部件的控制过程ssl 用GSKit 与SSL Channel 安全数据,不支持WebSphere MQ forWindowsversiondata WebSphere MQ 版本信息[-l MaxSize] Trace 文件(AMQnnnn.TRC) 的上限。
以MB 为单位。
如果达到上限,Trace 文件会更名为AMQnnnn.TRS,且创建出新的Trace 文件AMQnnnn.TRC。
如果原来存在AMQnnnn.TRS,则原来的文件被删除。
例:strmqtrc -m QMstrmqtrc -m QM -estrmqtrc -m QM -t all -x sslendmqtrc 停止Trace (End Trace,Windows 平台)解释同后endmqtrc 停止Trace (End Trace,HP-UX,Solaris,Linux 平台)[-m QMgrName] 缺省为系统的缺省队列管理器[-e] Early Tracing.[-a] All Tracing。