4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / /

Similar documents
1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

untitled

epub83-1

2 Java 语 言 程 序 设 计 教 程 简 单 性 Java 语 言 的 语 法 与 C 语 言 和 C++ 语 言 很 接 近, 使 得 大 多 数 程 序 员 很 容 易 学 习 和 使 用 Java 另 一 方 面,Java 丢 弃 了 C++ 中 很 少 使 用 的 很 难

ebook

Learning Java

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

基于ECO的UML模型驱动的数据库应用开发1.doc

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

Java 1 Java String Date

新・解きながら学ぶJava

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

1. 访 问 最 新 发 行 公 告 信 息 jconnect for JDBC 访 问 最 新 发 行 公 告 信 息 最 新 版 本 的 发 行 公 告 可 以 从 网 上 获 得 若 要 查 找 在 本 产 品 发 布 后 增 加 的 重 要 产 品 或 文 档 信 息, 请 访

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

FY.DOC

内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌

基于CDIO一体化理念的课程教学大纲设计

EJB-Programming-3.PDF

附录J:Eclipse教程

产品手册: CA GEN r8

ebook140-8

SiteView技术白皮书

<4D F736F F D20BBF9D3DA416E64726F6964C6BDCCA8B5C4B5E7D7D3C5C4C2F4CFB5CDB32E646F63>

Microsoft PowerPoint - 第一讲 概论.ppt

第3章.doc

untitled

( 含 要 ) 1-2 用 或 雇 用, 抑 或 有 無 俸 給 文 職 或 武 職, 政 官 或 事 官 均 屬 之, 其 不 以 具 備 人 資 格 為 限, 因 此 屬 於 最 廣 義 之 念 四 廣 義 念 之 依 服 24 條 之 規 定 : 本 於 受 有 俸 給 之 文 武 職, 及

RUN_PC連載_12_.doc

EJB-Programming-4-cn.doc

一 套 真 正 只 用 Server Cluster 集 群 结 构 的 模 式 覆 盖 多 种 硬 件 平 台 操 作 系 统 和 数 据 库 的 数 据 传 输 平 台 和 联 机 事 务 处 理 软 件, 并 且 能 够 自 由 组 合 这 些 平 台 形 成 最 佳 应 用 环 境 具 有

ebook 185-6

提纲 1 2 OS Examples for 3

ebook 96-16

先生別耍我

提问袁小兵:

Microsoft Word - cr_xi_supported_platforms_tw.doc

untitled

目 錄 壹 甄 試 重 要 時 程 表... 1 貳 甄 試 類 別 報 考 資 格 條 件 筆 試 科 目 需 才 地 區 及 錄 取 名 額... 2 參 甄 試 方 式 肆 報 名 期 間 及 方 式 伍 測 驗 日 期 時 間 及 應 攜 帶 繳 交 證 件 資 料.

Eclipse C C++, or

苗 ) 种 质 资 源 进 出 口 的 审 批 工 作 ; 组 织 农 作 物 品 种 管 理, 拟 订 农 作 物 品 种 审 定 和 农 业 植 物 新 品 种 保 护 的 办 法 标 准, 承 担 农 作 物 品 种 审 定 登 记 和 农 业 植 物 新 品 种 授 权 复 审 工 作, 组

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

FAQ -PowerDesigner9.5.DOC

RunPC2_.doc

PowerPoint 演示文稿

59 1 CSpace 2 CSpace CSpace URL CSpace 1 CSpace URL 2 Lucene 3 ID 4 ID Web 1. 2 CSpace LireSolr 3 LireSolr 3 Web LireSolr ID

Chapter 9: Objects and Classes

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

ebook140-9

新版 明解C言語入門編

Java

handsome-招股书-新规则-final-version-0422.PDF

untitled

untitled

软件概述

untitled

ArcGIS Sever.NET ArcGIS Server Web JAVA ArcGIS Server Web

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

untitled

untitled

個 人 的 手, 拉 著 瞎 子 的 手 把 他 帶 往 村 外 的 時 候, 對 於 瞎 子 來 講, 那 個 人 的 手 和 耶 穌 的 手 有 沒 有 區 別? 沒 有! 為 什 麼 沒 有 區 別? 因 為 對 於 一 個 瞎 子 來 說, 手 和 耳 朵 就 是 他 接 觸 世 界, 瞭

概述

AL-MX200 Series

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

Symantec™ Sygate Enterprise Protection 防护代理安装使用指南

SQL Server SQL Server SQL Mail Windows NT

ArcIMS ArcIMS Shape ArcIMS Monitor ArcIMS Tasker ArcIMS Windows NT UNIX ArcIMS ArcIMS MapService ArcIMS ArcIMS ArcIMS ArcIMS JAVA Windows NT UNIX ArcI

HP LaserJet Pro M1530 MFP Series User Guide - ZHTW

Microsoft PowerPoint - ch6 [相容模式]

G indd

FileMaker 15 ODBC 和 JDBC 指南

Oracle 4


1


Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

epub 61-2

校友会系统白皮书feb_08

C/C++程序设计 - 字符串与格式化输入/输出

0SQL SQL SQL SQL SQL 3 SQL DBMS Oracle DBMS DBMS DBMS DBMS RDBMS R DBMS 2 DBMS RDBMS R SQL SQL SQL SQL SELECT au_fname,au_ lname FROM authors ORDER BY


KillTest 质量更高 服务更好 学习资料 半年免费更新服务

新・明解C言語入門編『索引』

网上路演公告-final.PDF

概述

基于UML建模的管理管理信息系统项目案例导航——VB篇

入學考試網上報名指南

collateral 1.doc

untitled

政府機關資訊通報第295期(5月)

IBM Rational ClearQuest Client for Eclipse 1/ IBM Rational ClearQuest Client for Ecl

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS

目 录 1. 概 述 总 体 方 案 方 案 概 述 软 件 部 署 架 构 技 术 原 理 访 问 场 景 典 型 设 备 ipad 配 置 使 用 示 例 详 细

extend

Microsoft Word _2 課本1225_OK_0222修.doc

< C4EAC5E0D1B5BCC6BBAEB1ED2E786C73>

A API Application Programming Interface 见 应 用 程 序 编 程 接 口 ARP Address Resolution Protocol 地 址 解 析 协 议 为 IP 地 址 到 对 应 的 硬 件 地 址 之 间 提 供 动 态 映 射 阿 里 云 内

SP_ SP_03 JAVA...6 SP_10 SQL...8 SP_ SP_ SP_ SP_ SP_ SP_ SP_ SP_04.NET...33 SP_02 C...37 SP_05

Chapter 9: Objects and Classes

Transcription:

4 AMI AMI AMI SC345604 89

4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / / 91 41-90

41 AMI - AMI - - API MQI MQSeries MQI AMI IBM 91

MQSeries REPOSITORY AMI AMI AMI XML Windows AMI service point ORDERS MQSeries AMI SupportPac MA0Ffor Windows NT 92 Windows NT 4.0 Windows 2000 IBM MQSeries AMI>IBM MQSeries AMI Administration Tool Windows

\amt\amitool\amitool.bat 42 AMI 42 AMI AMI MQSeries MQSeries 93

AMI AMI AMI MQSeries API MQIMQSeries Classes for JavaActiveX MQSeries / WebSphere MQ Integrator AMI / / MQSeries API AMIAMI SupportPac MA0F IBM http://www.ibm.com/software/ts/mqseries/txppacs/ AMI / MQSeries Publish/Subscribe SupportPac MA0C 4.2 4.1 90 AMI CC++ Java Windows NT Windows 2000 AIX 4.3 Sun Solaris 2.6 2.7 HPUX 11.0 AS/400 4R4 AMI COBOL OS/390 2R6 CICS 4.1 IMS 5.1 AMI 94 C COBOL OS/390 AMI

Java C++ / C C C AMI 41 C API - 41 C - #include <stdio.h> #include <stdlib.h> #include <string.h> #include <amtc.h> #include <time.h> int mainvoid { /* */ hsession amsescreatesample_session_name, &compcode, &reason hpol amsescreatepolicyhsession, SAMPLE_POLICY_NAME, &compcode, &reason hsender amsescreatesenderhsession, SAMPLE_SENDER_NAME, &compcode, &reason success amsesopenhsession, hpol, &compcode, &reason success amsndopenhsender, hpol, &compcode, &reason success amsndsendhsender, hpol, AMH_NULL_HANDLE, AMH_NULL_HANDLE, strlensamplemsg, unsigned char *samplemsg, AMH_NULL_HANDLE, &compcode, &reason success amsesdelete&hsession, &compcode, &reason endsampleexit_success } 42 41 - Java API 42 Java - import java.util.* import com.ibm.mq.amt.*... public void main { mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionsample_session_name mypolicy mysession.createpolicysample_policy_name 95

} mysender mysession.createsendersample_sender_name mysendmsg mysession.createmessagesample_message_name mysession.openmypolicy mysender.openmypolicy String samplemessage new String"Sample message" mysendmsg.writebytessamplemessage.getbytes mysender.sendmysendmsg mysender.closemypolicy mysession.closemypolicy 4.3 AMI AMI C AMI amtc.h AMI #include <amtc.h> 41 AMI amtc.h 41 AMI C AS400 QMQAMI/H UNIX AIX, HPUX Solaris {MQSeries }/amt/inc Windows OS/390 {MQSeries }\amt\include hlq.scsqc370 amtc.h C++ AMI amtcpp.hpp C++ C amtcpp.hpp #include<amtcpp.hpp> 96

42 amtcpp.hpp AMI 42 AMI C++ AS/400 UNIX AIXHPUX Solaris Windows QMQAMI/H {MQSeries }/amt/inc {MQSeries }\amt\include amtcpp.hpp amtc.h amtcpp.hpp Java API AMI AMI package for Java JAR Java com.ibm.mq.amt Java JAR com.ibm.mq.amt.jar AMI package for Java import com.ibm.mq.amt.* JAR CLASSPATH Java 43 AMI JAR AMI 43 AMI Java JAR AS/400 /QIBM/ProdData/mqm/amt/Java/lib UNIX AIXHPUX Solaris{MQSeries }/java/lib Windows {MQSeries }\java\lib COBOL AMI copybooks AMTV AMTELEML AMELEM AMI 97

AMTELEMV AMTELEML AMTELEMV OS/390 hlq.scsqcobc MQSeries AMTELEMV AMELEM strucid version AMI 44 AMI CCOBOLC++ Java 44 AIX OS/400 HPUX OS/390 Sun Solaris C++ 5.0 VisualAge JDK 1.1.7 Java5769JV1 AS/400 Developer Kit AS/4005769CX2 ILE C AS/4005799GDW ILE C++ C++ for 0S/4005716CX4 Visual Age HP ac++ B3910B A.03.10 HP ac++ B3910B A.03.04970930 JDK 1.1.7 OS/390 C/C++ 2 6 OS/390 & VM 2 1 IBM COBOL MVS VM 1 2 IBM COBOL Workshop Compiler 4.2 Solaris 2.6 Workshop Compiler 5.0 Solaris 7 JDK 1.1.7 Windows Microsoft Visual C++ Version 6 JDK 1.1.7 AMI MQSeries 4.4 98 AMI

AMI MQOD MQOD / / 43 AMI 99

43 AMI AMI C++Java Helper and Exception objects 100

4.5 AMI AMI 3 Java AMI 4.5.1 MQSeries API AMI Java C++Java SessionFactoryObject new AmSessionFactoryString factoryname FactoryName C:\Program Files\MQSeries\amt AMT_DATA_PATH MQSeries AMI SupportPacMA0F AmSessionFactory createsession mysessionfactory.createsessionstring sessionname sessionname MQSeries MQI 23 MQI API MQCONN AMI {MQSeries }/amt amthost.xml 43 ITSOH defaultconnection 101

43 <?xml version 1.0encoding UTF8?> <queuemanagersnames defaultconnection ITSOH connectionname1 queuemanagername1connectionname2 queuemanagername2/> 44 AmSessionFactory ITSO AmSession 44 private AmSessionFactory mysessionfactory null private AmSession mysession null // // Since we are not specifying a name for the AmSessionFactory, // we expect the AMI files to be stored in the default AMI // location. // mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso AMI 1. 2. 3. / / / / 4. 4.5.2 MQSeries / AMI AmSession createpolicy sessionobject.createpolicystring policyname 102

policyname 45 AMT.SAMPLE.POLICY AMT.SAMPLE.POLICY 45 public static void main { AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy } / createsender sessionobject.createsenderstring sendername sendername 46 AMT.SENDER.NAME 46 AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null 103

mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mysender mysession.createsenderamt.sender.name createreceiver sessionobject.createreceiverstring receivername receivername 47 AMT.RECEIVER.NAME 47 AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null AmReceiver myreceiver null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy myreceiver mysession.createreceiveramt.receiver.name createpublisher sessionobject.createpublisherstring publishername publishername MQRFH MQRFH / / 48 AMT.PUBLISHER.NAME 104

48 AmSessionFactory AmSession AmPolicy AmPublisher mysessionfactory null mysession null mypolicy null mypublisher null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mypublisher mysession.createpublisheramt.publisher.name createsubscriber sessionobject.createsubscriberstring subscribername subscribername 47 AMT.SAMPLE.SUBSCRIBER 49 public static void main {... AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mysubscriber mysession.createsubscriberamt.sample.subscriber } 105

createdistributionlist sessionobject.createdistributionliststring distributionlistname 410 410 public static void main { AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mysender mysession.createdistributionlistamt.distribution.list } 44 AMT.DISTRIBUTION.LIST 106

44 AMT.DISTRIBUTION.LIST AmSession createmessage AmSession.createMessageString messagename MessageName 411 ITSO.SAMPLE.MESSAGE.NAME 411 public static void main { AmSessionFactory mysessionfactory null AmSession mysession null 107

AmPolicy AmPolicy AmMessage mypolicy null mypolicy null mysendmsg null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mysender mysession.createsenderamt.sender_name mysendmsg mysession.createmessageitso.sample.message.name } open open 102 AmSession createpolicy AmSession.openAmPolicy policyobject AmSender.openAmPolicy policyobject AmReceiver.open AmPolicy policyobject AmPublisher.openAmPolicy policyobject AmSubscriber.openAmPolicy policyobject 412 412 Open the session factory Create the required objects session, publisher, message, etc. /... mypolicy mysession.createpolicyamt.sample.policy mysession.openmypolicy mypublisher.openmypolicy myrespreceiver.openmypolicy 108

4.5.3 4.5.2 MQSeries 102 MQSeries MQI MQI MQOO_INPUT_SHARED, MQOO_OUTPUT AMI send Java getbytes Java writebytes senderobject.sendammessage messageobject, AmReceiver receiverobject/ammessage receivedmessage, AmPolicy policyobject / 413 413 public static void main { 109

AmSessionFactory AmSession AmPolicy AmSender AmMessage mysessionfactory null mysession null mypolicy null mysender null mysendmsg null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mysender mysession.createsenderamt.sender_name mysendmsg mysession.createmessageitso.sample.message.name String samplemessage new String"Sample message" mysendmsg.writebytessamplemessage.getbytes mysender.sendmysendmsg } distributionlist send 4.5.2 MQSeries 102 414 414 public static void main { AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null AmDistributionList mydistributionlst null AmMessage mysendmsg null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mydistributionlst mysession.createdistributionlistitso.distribution.list mysendmsg mysession.createmessageitso.sample.message.name String samplemessage new String"Sample message" mysendmsg.writebytessamplemessage.getbytes mydistributionlist.sendmysendmsg } receive amreceiver.receiveammessage messageobject, AmSender senderobject, AmMessage selectionmessageobject, AmPolicy policyobject 110

4 messageobject senderobject PolicyObject IDcorrelation ID selectionmessageobject readbytes 415 415 public static void main { AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null AmReceiver myreceiver null AmMessage myreceivemsg null AmMessage mysendmsg null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyitso.sample.policy myreceivemsg mysession.createmessageitso.sample.message.name myreceiver.receivemyreceivemsg String samplemessage new StringMyReceiveMSG.readbytesmyReceiveMSG.getDataLength } addtopic messageobject.addtopicstring topicname topicname 111

publish publisherobject.publishammessage messageobject, AmReceiver receiverobject, AmPolicy policyobject messageobject implicit registration receiverobject MessageObject policyobject 416 policyobject receiverobject 416 Create and open required objects session, policy, message and publisher string pubmessage SUNNY mysendmsg.addtopicweather mysendmsg.writebytespubmessage.getbytes mypublisher.publishmysendmsg addtopic messageobject.addtopicstring topicname topicname subscribe 112

subscriberobject.subscribeammessage messageobject, AmReceiver receiverobject, AmPolicy policyobject messageobject addtopic receiverobject receive PolicyObject receiverobject receive subscriberobject.receiveammessage messageobject, AmMessage selectionmessageobject, AmPolicy policyobject messageobject ID selectionmessageobject PolicyObject unsubscribe subscribeobject.unsubscribeammessage messageobject, AmReceiver receiverobject, AmPolicy policyobject messageobject receiverobject 4 17 417 113

int icounter 0 String topic Weather mysendmsg.addtopicweather mysubscriber.subscribemysendmsg, mypolicy // Only 5 messages are expected for icounter 0iCounter < 5iCounter++ mysubscriber.receivemyreceivemsg, mypolicy String myrequest new StringmyReceiveMSG.readBytesmyReceiveMSG.getDataLength System.out.printlnmyRequest } // The application has received all the messages that it wanted so it proceeds // to send an unsubscribe request. mysubscriber.unsubscribemysendmsg, mypolicy 4.5.4 close subscriberobject.closeampolicy policy Object sessionobject.closeampolicy policy Object receiverobject.closeampolicy policy Object publisherobject.closeampolicy policy Object distributionlistobject.closeampolicy policy Object close policyobject MQSeries sessionobject sessionobject 114

4.6 AMIMQI MQSeries API AMI MQI MQI / AMI MQI MQSeries AMI MQSeries MQI CC++Java COBOL API AMI API MQI AMI MQI IBM AMI / API C++Java 4.7 AMI AMI General API MQSeries commit rollback 418 MQSeries 115

418 public static void main { AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null AmReceiver myreceiver null AmMessage myreceivemsg null AmMessage mysendmsg null mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyitso.sample.policy myreceivemsg mysession.createmessageitso.sample.message.name myreceiver.receivemyreceivemsg // If no failures were found commit the action mysession.commitmypolicy String samplemessage new StringMyReceiveMSG.readbytesmyReceiveMSG.getDataLength // If some problems were found, dont retrieve the message mysession.rollbackmypolicy } MQSeries XA XA transaction coordinator AmSession begin AmSession commit AmSession rollback 419 MQSeries XA 419 MQSeries XA public static void main { AmSessionFactory mysessionfactory null AmSession mysession null AmPolicy mypolicy null AmSender mysender null AmMessage mysendmsg null // Connect to the database mysessionfactory new AmSessionFactory mysession mysessionfactory.createsessionitso.session.name mypolicy mysession.createpolicyamt.sample.policy mysender mysession.createsenderamt.sender_name 116

mysendmsg mysession.createmessageitso.sample.message.name mysession.beginmypolicy // Update a table. // If the update was successful then commit the action and send a message to // another application String samplemessage new String"Sample message" mysendmsg.writebytessamplemessage.getbytes mysender.sendmysendmsg mysession.commitmypolicy // If problems occurred during the update, backout the changes mysession.rollbackmypolicy } Tuxedo API AMI 4.8 AMI group context information group status information AMGRP_FIRST_MSG_IN_GROUP AMGRP_MIDDLEMSG_IN_GROUP AMGRP_LAST_MSG_IN_GRP setgroupstatus messageobject.setgroupstatusint groupstatus groupstatus AMGRP_MSG_NOT_IN_GROUP AMGRP_FIRST_MSG_IN_GRP AMGRP_MIDDLE_MSG_IN_GRP 117

AMGRP_LAST_MSG_IN_GROUP AMGRP_ONLY_MSG_IN_GROUP AMGRP_FIRST_MSG_IN_GROUP AMGRP_MIDDLE_MSG_IN_GRP 4.9 AMI 4.9.1 - - Java JVM MQSeries AMI Java 420 CLASSPATH JAR 118

420 import com.ibm.mq.amt.* AMI JAR - 421 421 private AmSessionFactory mysessionfactory null private AmSession mysession null private AmSender mysender null private AmMessage mysendmsg null private AmPolicy mypolicy null 422 mysessionfactory 421 422 mysessionfactory new AmSessionFactory createsession createpolicy createsender createmessage 4 23 SAMPLE_SESSION_NAME SAMPLE_POLICY_NAME SAMPLE_SENDER_NAME SAMPLE_MESSAGE_NAME 424 mysession mysessionfactory.createsessionsample_session_name mypolicy mysession.createpolicysample_policy_name mysender mysession.createsendersample_sender_name 119

mysendmsg mysession.createmessagesample_message_name 424 mysession mysender 424 mysession.openmypolicy mysender.openmypolicy send 4.5.3 109 Java getbytes Java writebytes 425 819 425 String samplemessage new String"Sample message" mysendmsg.setccsid819 mysendmsg.writebytessamplemessage.getbytes mysender.sendmysendmsg, mypolicy close 426 424 120 426 mysender.closemypolicy mysession.closemypolicy / / 120

writebytes waittime readbytes Java JVM MQSeries AMI Java classes 427 CLASSPATH JAR 427 import com.ibm.mq.amt.* AMI JAR / 428 428 private AmSessionFactory mysessionfactory null private AmSession mysession null private AmSender mysender null private AmReceiver myreceiver null private AmMessage mysendmsg null private AmMessage myreceivemsg null 121

private AmPolicy mypolicy null 429 mysessionfactory 428 429 mysessionfactory new AmSessionFactory createsessioncreatepolicycreatesendercreatereceiver createmessage 430 SMAPLE_SESSION_NAME SAMPLE_POLICY_NAME SAMPLE_SENDER_NAME SAMPLE_RECEIVER_NAME SAMPLE_SEND_MESSAGE_NAME SAMPLE_RECEIVE_MESSAGE_NAME 430 mysession mysessionfactory.createsession SAMPLE_SESSION_NAME mypolicy mysession.createpolicy SAMPLE_POLICY_NAME mysender mysession.createsender SAMPLE_SENDER_NAME myreceiver mysession.createreceiver SAMPLE_RECEIVER_NAME mysendmsg mysession.createmessage SAMPLE_SEND_MESSAGE_NAME myreceivemsg mysession.createmessage SAMPLE_RECEIVE_MESSAGE_NAME 431 mysession mysender myreceiver 431 mysession.openmypolicy mysender.openmypolicy myreceiver.openmypolicy 122

send 4.5.3 109 Java getbytes Java writebytes 432 819 432 String samplemessage "Sample message" mysendmsg.setccsid819 mysendmsg.writebytessamplemessage.getbytes mysender.sendmysendmsg, myreceiver, mypolicy setwaittime receive readbytes 433 2000 433 mypolicy.setwaittime2000 mysendmsg.setccsidamcp_819 myreceiver.receivemyreceivemsg, mysendmsg, mypolicy replymessage new StringmyReceiveMSG.readBytesmyReceiveMSG.getDataLength,"ISO8859_1" close close 434 431 434 mysender.closemypolicy myreceiver.closemypolicy mysession.closemypolicy 123

4.9.2 / addtopic writebytes Java JVM MQSeries AMI Java classes 435 CLASSPATH JAR 124

435 import com.ibm.mq.amt.* AMI JAR / 436 436 private AmSessionFactory mysessionfactory null private AmSession mysession null private AmPublisher mypublisher null private AmMessage mysendmsg null private AmMessage myrespmsg null private AmPolicy mypolicy null private AmReceiver myrespreceiver null 437 mysessionfactory 436 437 mysessionfactory new AmSessionFactory createsession createpolicy createsender createreceiver createmessage 438 SMAPLE_SESSION_NAME SAMPLE_POLICY_NAME SAMPLE_PUBLISHER_NAME SAMPLE_RESPONSE_NAME 125

SAMPLE_MESSAGE_NAME SAMPLE_RESP_MESSAGE_NAME 438 mysession mysessionfactory.createsession SAMPLE_SESSION_NAME mypolicy mysession.createpolicy SAMPLE_POLICY_NAME mypublisher mysession.createpublisher SAMPLE_PUBLISHER_NAME myrespreceiver mysession.createreceiver SAMPLE_RESPONSE_NAME mysendmsg mysession.createmessage SAMPLE_MESSAGE_NAME myrespmsg mysession.createmessage SAMPLE_RESP_MESSAGE_NAME 439 mysession mypublisher myrespreceiver 439 mysession.openmypolicy mypublisher.openmypolicy myrespreceiver.openmypolicy addtopic 440 438 CCSID mysendmsg myrespreceiver 440 String sunny "SUNNY again" String showers "WIND and SCATTERED showers" String rain "HEAVY RAIN" String outlook[] {sunny, showers, rain} for int i 0, j 0i < SAMPLE_MAX_PUBLICATIONSi++, j++ { try { mysendmsg.addtopic Weather if j 3 126

{ j 0 } String samplemessage new Stringoutlook[j] mysendmsg.setccsid819 mysendmsg.writebytessamplemessage.getbytes"iso8859_1" mypublisher.publishmysendmsg, myrespreceiver, mypolicy myrespreceiver.receivemyrespmsg, mysendmsg, mypolicy } } close close 441 439 441 mypublisher.closemypolicy myreceiver.closemypolicy mysession.closemypolicy addtopic 127

readbytes Java JVM MQSeries AMI Java classes 442 CLASSPATH JAR 442 import com.ibm.mq.amt.* AMI JAR 443 443 private AmSessionFactory mysessionfactory null private AmSession mysession null private AmSubscriber mysubscriber null private AmMessage mysendmsg null private AmMessage myreceivemsg null private AmPolicy mypolicy null 444 mysessionfactory 443 128

444 mysessionfactory new AmSessionFactory createsessioncreatepolicycreatesender createmessage 445 SMAPLE_SESSION_NAME SAMPLE_POLICY_NAME SAMPLE_SUBSCRIBER_NAME SAMPLE_RESPONSE_NAME SAMPLE_RECEIVE_MESSAGE_NAME SAMPLE_SEND_MESSAGE_NAME 445 mysessionfactory new AmSessionFactory mysession mysessionfactory.createsession SAMPLE_SESSION_NAME mypolicy mysession.createpolicy SAMPLE_POLICY_NAME mysubscriber mysession.createsubscriber SAMPLE_SUBSCRIBER_NAME myreceivemsg mysession.createmessage SAMPLE_RECEIVE_MESSAGE_NAME mysendmsg mysession.createmessage SAMPLE_SEND_MESSAGE_NAME 446 mysession mysubscriber 446 mysession.openmypolicy mysubscriber.openmypolicy 447 addtopic mysendmsg mysubscriber subscribe 447 String topic "Weather" Try 129

{ mysendmsg.reset mysendmsg.addtopictopic mysubscriber.subscribemysendmsg, mypolicy } mysubscriber receive readbytes 448 448 for i 0i < SAMPLE_MAX_PUBLICATIONSi++ { try { mysubscriber.receivemyreceivemsg, mypolicy String myrequest new StringmyReceiveMSG.readBytesmyReceiveMSG.getDataLength,"ISO8859_1" System.out.printlnmyRequest myreceivemsg.reset } } 449 mysubscriber unsubscribe 449 String topic "Weather" try { mysendmsg.reset mysendmsg.addtopictopic // // Send the request. //No response is expected so no receiver object is passed. // mysubscriber.unsubscribemysendmsg, mypolicy } 130

close close 450 446 129 450 mysubscriber.closemypolicy mysession.closemypolicy AMI MQSeries 131

132