中间件课程复习

//1,2,3,4,5,6,7,9

中间件实验报告要求:

实验1,2,3,4,5,6,7,9
word文档形式提交
写每一次实验的心得
字数不限

中间件小测要求

如下全部Unit

中间件期末考试要求

应想哥请求,重新做全部实验并尽量详细补充过程;
两人一组,考察所有实验的内容,即 实验 2,3,4,5,6,7,9

在这里插入图片描述

Unit1. A review of WebSphere MQ

  1. T or F: WebSphere MQ only supports asynchronous mesaging.
    F

2.WebSphere MQ assured delivery means that
a.A report of delivery can always be sent back.
b.Unless the entire system goes down, no messages are lost
c.Messages can be duplicated but never lost
d.Mesasges are delivered with no loss or duplication

3.Applictaions place messages on queues by use of the:
a. WebSphere MQ program-to-program interface
b.WebSphere MQ message queue interface
c.WebSphere MQ command processor

Unit2. Installation and configuration of WebSphere MQ on Windows and UNIX

1.T or F: Queue manager names can be made up of any printable ASCII characters.
F

2.Alias queues can point to what other queue types?
a.Another alias queue
b.Local queues
c.Model queues

3.Any local queue can be a dead letter queue if it:
a.is identified as the dead letter queue to the queue manager
b.Has put enabled
c.Is not being used by any other application

  1. T or F: Altering queue attributes can be done while the queue manager is running is running and the changes take effect immediately.
    T

Unit3 - 实验 1 Working with queues

  1. What does runmqsc -v commad parameter do?
    a.Show the runmqsc verision
    b.switch to verbose mode
    c.run script in verify mode
    d.cause a trace of runmqsc

2.Which is not an administrative interface?
a.MQAI
b.PCF
c.MQI
d.MQSC

3.Is the following script command valid?
alter ql(ANDREW) TRIGGER TRIGTYPE(DEPTH) DEPTH(10)
Yes

crtmqm   QMCyuan; //创建一个队列管理器
strmqm QMCyuan;//开启一个队列管理器
runmqsc QMCyuan;//启动一个队列管理器
display qmgr; //查看一个队列管理器的信息
display Q(SYSTEM*) ;//查看某一队列的信息
define QL(QL.A); //定义一个本地队列
alter QL(QL.A) maxdepth(1000);//修改一个队列的属性

replace -> 覆盖,e.g.若之前定义了某一消息队列,再次定义使用replace命令则会覆盖之前的消息队列
amqsput QL.A QMCyuan;//往消息队列中放消息
amqsgbr QL.A QMCyuan;//查阅消息队列
amqsbcg QL.A QMCyuan;//查阅消息队列
amqsget QL.A; //从消息队列中获取消息

display QL(QL.A) curdepth

define QL(QL.X) like(QA.A) ;//创建一个队列,其属性和QL.A一样
clear QL(QL.A); //清空队列
delete QL(QL.A);//删除队列
delete QL(QL.X) purge;//强制删除队列

心得:
	通过本次实验,我知道了IBM MQ的基本用法,知道了它的基本层次结构,了解到了replace命令的用法;

Unit4. WebSphere MQ Explorer

  1. Displaying the status of a selected queue shows which of these?
    a. Current queue depth
    b.Name of the applications currently using the queue
    c.The time of the last PUT operation on the queue
    d.Whether messages are persistent
    e.User ID the process using the queue is running under

2.What three objects must be defined to be able to administer a remote queue manager?
A running command server
A running listener
A server connection channel

3.T or F : Queue managers can be grouped into sets and the Explorer allows actions to be performed on all the queue managers defiend to set.
T

Unit5. Introduction to the Message Queue Interface

1.T or F: A permanent dynamic queue is always persistent.
F, it can have persistent messages and survives qmgr restarts, but can also contain non-persistent messages.

  1. T or F: The correlations identifier is normally used to provide an application with a means of matching a reply or report message with the original message.
    T

  2. An application can retrieve a message from a queue based on:
    a. Mesage ID
    b.Corelation ID
    c.Next available message based on the MsgDeliverySequence value of the queue
    d.An SQL-92 like selector
    e.All of the above

Uint 6 - 实验2 Implementing triggering

1.What are the three trigger types?
First, depth, every, none;

2.What does the runmqtrm command do?
Starts the trigger monitor.

  1. Which of the following messages from the trigger monitor are reporting on normal activities?
    a.Waiting for a trigger message -> reports normal activities.
    b.Initiation queue cannot be opened -> reports abnormal conditions
    c.Use of trigger monitor not authorized -> reports abnormal condtions
    d.Trigger monitor ended -> reports normal activities

4.Which of the following condions are essential for TRIGTYPE(FIRST) to trigger?
a.Queue depth from 0-1
b.OPPROCS = 0

c.IPPROCS = 0
d.Trigger monitor must be running against the revelant INITQ

runmqsc liyuan
define QLOCAL(QL.INITQ)  replace
//设置trigger monitor触发条件为first
define  QL(QL.A) replace trigger trigtype(first) process(PR.ECHO) initq(QL.INITQ);
define process(PR.ECHO) replace applicid('amqsech');
define QMODEL(QM.REPLY) replace

//此时重新打开一个cmd窗口
runmqtrm -q QL.INITQ -m liyuan
//此时再重新打开一个窗口
amqsreq QL.A liyuan QM.REPLY
//此时输入字符串即可以触发trigger

//打开一个新cmd窗口
runmqsc liyuan
define process(PR.INQ) replace applicid('amqsinq')
alter QL(QL.A) process(PR.INQ)
amqsreq QL.A liyuan QM.REPLY
//此时输入即可触发我们之前打开的trigger monitor

//打开一个新的cmd窗口
runmqsc liyuan
//修改触发条件为depth
alter QL(QL.A) trigtype(depth) trigdpth(5)
//打开一个新的cmd窗口
amqsreq QL.A liyuan QM.REPLY
//输入5条消息后即触发trigger

心得:通过本次实验,我知道了如何给队列添加触发器,并设置触发器的属性;


实验3. Queue Recovery

Uint 8

  1. For what reason would linear logging be considered:
    a.Ease of administration
    b.Requirement that persistent queues be recoverable
    c.Requirement that queues be rolled back to a point particular time.
    d.Production environment

2.True of False: The dmpmqlog command should be used to backup Websphere MQ logs/
False, Logs can only be backed-up if the queue manager is stopped, then a suitable file backup utility should be used.
dupmqlog is a diagnostic tool only,

3.True or False: WebSphere MQ can be both an XA transaction coordinator and a transaction manager.
True

crtmqm -ll yuanxi
strmqm yuanxi
define QL(QL.A) defpsist(yes) repalce
define QL(QL.B) defpsist(yes) repalce

//创建2个别名队列分别指向本地的吗两个队列,defpsis(yes)表示消息是稳固的,即应用程序或网络出现问题时,queue里面的消息不会丢失;
define QA(QA.A) TARGQ(QL.A) defpsist(no) replace
define QA(QA.B) TARGQ(QL.B) defpsist(no) replace

clear QL(QL.A)
clear QL(QL.B)

//打开一个新的cmd窗口
amqsput QL.A yuanxi
amqsput QA.A yuanxi
amqsput QL.B yuanxi
amqsput QA.B yuanxi

//查看QL.A里面的消息
amqsgbr QL.A yuanxi


endmqm -i yuanxi
strmqm yuanxi
//重启后发现QL.A中的消息保存着,QA.A中的消息就消失了;
amqsgbr QL.A yuanxi

//生成一个QL.B的快照
rcdmqimg -m yuanxi -t ql QL.B

在这里插入图片描述


runmqsc yuanxi
display QL(QL.B)
/*删除对应的文件QL!B,我的文件在  
C:\ProgramData\IBM\MQ\qmgrs\yuanxi\queues
在该目录下删除QL!B文件

*/
//打开新的cmd窗口
amqsgbr QL.B yuanxi
//抛出 2101(MQRC_OBJECT_DAMAGED)错误

//通过快照复原QL.B
rcrmqobj -m yuanxi -t ql QL.B
//此时可以看到该队列的信息了
amqsgbr QL.B yuanxi
amqsget QL.B yuanxi

endmqm -i yuanxi
dltmqm yuanxi

心得:通过本次实验,我了解到了如何建立别名队列并设置其中的消息是否持久化,还了解到如何对某一队列进行快照处理并在该队列出问题时通过该快照恢复该队列;

实验4 Queue manager Interconnection

Uint 9
1.What are six types of message channels?
sender, receiver,server,requester,cluster sender,cluster receiver

2.True or False: A transmission queue is required for every remotely connected queue manager.
True, if a remote QMGR is not known, a default transmission queue is used.

3.What action prompts the channel initiator to start a sender channel?
When a message is placed on the initiation queue of the sending QMGR.

4.True or False: The sending end of a channel of CHLTYPE(SDR) has a transmission queue withe the same name as the queue manager at the other end of the channel.
True

5.What WebSphere MQ control command shows the current state of a channel?
display chl(QMCS.QMCR)

//发送方
crtmqm QMCS
strmqm QMCS
runmqsc QMCS
//定义一个传输队列,其名字与远程队列名字一样
def ql(QMCR) replace usage(xmitq) 
//定义一个管道,其使用上述定义的传输队列
def chl(QMCS.QMCR) chltype(SDR) trptype(tcp) conname ('127.0.0.1(8080)') xmitq(QMCR)  
//定义一个死性队列
def ql(dlq) replace;
//设置队列管理器使用上述定义的死性队列
alter qmgr deadq(dlq)
ping chl(QMCS.QMCR)
def ql(QL.A) replace
//定义一个远程队列指向本地队列QL.A,并使用QMCR作为传输队列
def QR(QRMTR) replace rname(QL.A) RQMNAME(QMCR) XMITQ(QMCR)
start chl(QMCS.QMCR)
//重新打开一个cmd窗口
amqsput QRMTR QMCS

//定义一个model会对队列有暂时动态的响应;
define QMODEL(QM.REPLY) replace
define process(PR.INQ) replace applicid('amqsinq')
alter QL(QL.A) process(PR.INQ)

//接收方
//打开一个新的cmd窗口
crtmqm QMCR
strmqm QMCR
runmqsc QMCR
def chl(QMCS.QMCR) chltype(rcvr) replace trptype(tcp)
//定义消息队列 -  QMCS
def QL(QMCS) replace usage(XMITQ)
//定义本地队列QL.A
def QL(QL.A) replace
//定义死性队列
def QL(DLQ) replace
//设置当前队列管理器使用上述的死性队列
alter QMGR DEADQ(DLQ)
//等待其他方的TCP管道连接
runmqlsr -t TCP -p 8080 -m QMCR 
//开启管道QMCS.QMCR
start chl(QMCS.QMCR)

//通过本地的QRMTR指向远程队列QMCR.QL.A,并向其放消息
amqsreq QRMTR QMCS QM.EMPTY

//经过测试,当在若干时间内没有操作时,通道会自动关闭,
//因此若发现无法将消息发送到对面,可考虑重启通道
amqsget QL.A QMCR


//
define QL(QL.INITQ)
alter QL(QL.A) trigger trigtype(first) initq(QL.INITQ) process(PR.ECHO)
runmqtrm -q QL.INITQ -m QMCS
define QMODEL(QM.REPLY)

amqsreq QRMTR QMCS QM.REPLY
心得:通过本章的学习,我学习到了如何使远程MQ 队列管理器通信,大致流程是接收方定义一个通道并监听发送方将要传送数据的端口;发送方需要定义远程队列并指明指向该队列管理器哪一个队列并指明传输队列,当消息传送不过去时消息会阻塞在该队列中

mqrc xxxx;//查询状态码

实验5 Dead letter queue handling

Uint 10
1.What will happen if a dead-letter queue does not exist and a message cannot be delivered?What is the one exception to this rule?
The channel stops and the message remains on the transimission queue at the sending end.The exception is when the message is a fast, non-persistent message. The type of message will be discarded and the channel remains open;

2.What is the purpose of a dead-letter queue handler?
To provide an automated way of handling messages on the dead-letter queue.

3.From a dead-letter queue handler rules table:
destqm(A1) action(fwd) fwdq(Q1) fwdqm(A2)
a.Where will a message destined for queue manager A1 be found?
It will be forwarded to queue Q1 on queue manager A2;
b.How can the rule be modified so that the message will be stripped of its dead letter header?
Add header(no) to the rule.

//注意:此次实验是在实验4的基础上
rrunmqlsr -t TCP -p 8080 -m QMCR
runmqsc QMCS
start chl(QMCS.QMCR)
runmqsc QMCR
start chl(QMCR.QMCS)

//向QRMTR传输队列中放的消息会传输至 QMCR.QL.A队列中
amqsput QRMTR QMCS

//设置 QMCR.QL.A put(disabled)
alter QL(QL.A) put(disabled);
//打开新的cmd窗口
amqsput QRMTR QMCS
//由于接收方的QL.A put(disabled)因此消息会放到接收方的DeadLocalQueue中

//打开新的cmd窗口
amqsgbr DLQ QMCR
amqcbcg DLQ QMCR

在这里插入图片描述

mqrc 0x00000803

在这里插入图片描述
心得:通过本次实验,我知道了队列之间通信的过程中,是通过将消息放在发送方的QRMTR中,再同时开启发送方和接收方的通道即可,这样消息就会自动传送给接收方的接受队列中,若该接受队列被设置为put(diabled),则消息会自动被转存到Dead Local Queue 中;

实验6 WebShpere MQ clustering setup (依旧有些乱)

Uint 11

  1. Which describes the main purpose of clustering?
    a.Simplified administration
    b.Workload balancing
    c.Flexible connectivity
    d.To enable publish/subscribe
    e.All of above

2.T or F: To send cluster messages to a partial repository QMGR from a full repository QMGR, standard sender-receiver channels are required.
False. As both QMGRs are part of the cluster, both a cluster-sender and a cluster-receiver channel pair needs to be defined.

  1. T or F: The SYSTEM.CLUSTER.COMMAND.QUEUE holds inbound and outbound adminstrative messages.
    False, it only holds inbound administtrative message.

  2. What is the default name of the system queue which holds information about the repository?
    SYSTEM.CLUSTER.REPOSITORY.QUEUE

5.T or F. Remote queue definitions are not required when using clusters.
True

6.What does REPOS(YES) mean on a REFRESH CLUSTER command?
REPOS(YES) forces the queue manager to restart its search for full repositories from the information in the local CLUSSDR definitions and enforces a COLD START of the QMGR.

7.What is the queue attribute DEFBIND used for?
DEFBIND determines if rerouting is performed while a queue is opened.

***********STEP 1:**********
crtmqm MR1
strmqm MR1

***********STEP 3:**********
**FOR MN1
DEFINE QL(QC1) CLUSTER(CLUS12)
**FOR MR1
DEFINE QL(QC1) CLUSTER(CLUS12)
DEFINE QL(QL1) CLUSTER(CLUS12)

**FOR MN2
DEFINE QL(QC2) CLUSTER(CLUS12)
**FOR MR2
DEFINE QL(QC2) CLUSTER(CLUS12)
DEFINE QL(QL2) CLUSTER(CLUS12)

***********STEP 6:**********
***_5.
***FOR MR1,MN1,MR2,MN2****
ALTER QL(QC#) DEFBIND(NOTFIXED)
ALTER QMGR CLWLUSEQ(ANY)

心得:通过本次实验,我了解了MQ集群之间是如何通信

实验7 Object security administration with the OAM

Unit12

1.T or F - The MQSC command REFRESH SECURITY must be issued to make OAM changes take effect.
F. REFRESH SECURITY is only used to refresh security profiles from other external security products.

2.Using OAM, how would you protect local queue REBATE.IN on MY.QMGR for:
a. MQPUT access only by group ASSESSORS
setmqaut -m MY.QMGR -t q -n REBATE.IN -g ASSESSORS +put
b.MQGET by id PROCESSOR
setmqaut -m MY.QMGR -t q -n REBATE.IN -p PROCESSOR +get
c.MQGET browse only by group AUDITOR
setmqaut -m MY.QMGR -t q -n REBATE.IN -g AUDITOR +browse

3.For an application to open a queue using an alternate userid, the initial userid requires:
a.OAM delegate authority
b.OAM alternate user authority
c.Authority to use “runas” on WIndows or “su” on UNIX
d. password of alternate userid
e.None of the above


setmqaut -m MY.QMGR -t q -n REBATE.IN -g ASSESSORS +put
setmqaut -m MY.QMGR -t q -n REBATE.IN -p PROCESSOR +get
setmqaut -m MY.QMGR -t q -n REBATE.IN -g AUDITOR +browse

//删除ADMINISTRATOR用户的put权限
setmqaut -m liyuan -t q -n QL.A -p ADMINISTRATOR -put

//心得:通过本章的学习,我了解到了如何使用WebSphere MQ管理队列管理器的组以及用户的权限

13. WebSphere MQ clients

1.T or F: It is not possible to use the MQSERVER variable for LU6.2 protocol connections
F

2.T or F:CCDTs cannot be used with MQ Java applications.
F

3.T or F: a client channel with weighting = 0 is always selected.
Generally true, it is the default choice, but if the target queue manager is not available, then it is skipped.

4.Which is the following statements are true?
a. MAXINST limits the total number of client connections for a specific channel.
b.MAXINSTC limits the total number of connections for a specific channel from an individual client.
c.Affinity causes subsequent client connections from a specific client to return to the same channel.
d.All of the above

15. WebSphere MQ high availability

  1. Why would it not normally be necessary to define more than two WebSphere MQ cluster full repositories?
    Queue managers within the cluster only publish and subscribe to two of the full repositories.

2.How are logs replayed on a backup queue manager?
a. runmqlog -m QmgrName
b.alter amgr replay(log)
c.strmqm -r QmgrName
d.dmpmqlog -r QmgrName

  1. T of F: All platform HA solutions employ a floating IP address to effect transparent fail-over.
    True

4.T or F : Fail-over is effectively a queue manager restart so all non-persistent messages are lost.
T

实验9 Backup and restore of WebSphere MQ object definitions

Unit16

1.Should you run a backup while WebSphere MQ is running? if not, why?
No, as the backup will not be consistent because of updates in progress when the files were copied.

2.There are two methods to back up resource and object definitions.
Backing up resource definitions with runmqsc and using the MS03 SupportPac to save queue manager object definitions. What is the main difference between two?
Format of the output of the runmqsc command provides a report style view of the definitions which needs to be reformatted to be used for recreation purposes.
The saveqmgr command saves queue manager objects to a file in a format suitable for use with runmqsc. Therefore, objects can be easily recreated.

3.If you want to recreate your security definitions what would be the best method to back them up?
a.dmpmqaut
b.amqoamd -s
The ouput is given as a series of setmqaut commands which can be used using the command line to recreate the security definitions.

1.从文件管理系统中下载ms03_win
2.进入该目录,运行 saveqmgr命令
	saveqmgr -m -s QMC888 -q -f
	saveqmgr -m liyuan -q -f
3.此时在当前路径下会生成 QMC888.MQSC
4.runmqsc -v QMC888 < QMC888.MQSC

心得:经过本次实验,我了解到了如何将队列管理器信息转存到本地文件中并恢复。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
中间件期末考复习资料包含三个文档 一、课堂考点、重点题目、考试方向思考题全解 1.什么是消息型中间件 queue 和 topic 是什么意思 答: (1) 定义:消息中间件是分布式系统中完成消息发送和接收的基本软件。 消息中间件:一类支持在应用之间发送和接收消息的基础设施。利用高效可靠的消息机制 来实现不同应用间大量的数据交换。消息中间件的非直接连接,支持多种通信协议,达到 多个系统之间的数据的共享和同步,最常用的一类中间件。 (2)Queue 和 topic 是消息传送的模式。 Queue 是点对点的传送,消息发送者将消息发送到队列中,消息接收者从队列中 依次取出消息消费,一条消息被消费后将不再被存储。Queue 支持存在多个消费 者,但一条消息只能被一个消费者消费。 Topic 是发布/订阅模式,消息被发布到 topic 中可以同时被多个消费者订阅和 消费。 ...... 二、名词解释 1.RPC:远程过程调用是从一台机器或一个进程调用另一台机器或另一个进程的服务或方法。 2.RMI:远程方法激活,使软件开发人员能够开发这样的分布式程序:在这个分布式程序中,其远程对象的方法能够被运行在不同主机上的其他Java虚拟机(JVM)的方法所调用。 3.存根(桩)(Stub):桩是客户内部完成打包数据和管理网络连接工作的本地对象,在客户调用远程对象上作为方法时,它实际调用的本地存根对象上的方法。 4.框架(Skeleton):框架负责接收并解包远程方法调用为本地方法调用。 5.DCE:分布计算环境(DCE:Distributed Computing Environment)是开放软件基金会(OSF:Open Software Foundation)制定的以远程过程调用(RPC)为核心的一系列规范;提供线程服务、RPC服务、目录服务、安全服务、分布式文件服务以及时间服务。 6.ORB:对象请求代理ORB(Object Request Broker)是对象总线,它能使对象透明的向其他本地或远程对象发出请求或获得应答。 7.数据访问中间件:(DAM)在分布式系统中,通过提供一系列的编程接口,屏蔽不同网络协议,操作系统和数据库管理系统平台DBMS的差异,允许应用程序一致地访问数据源的一种中间件技术。 8.消息中间件:(MOM)依据消息传送或消息队列的原理来工作,提供可靠的、跨平台的同步或异步通信。 ...... 三、各章节重点知识点、结构总结
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值