Part II: Websphere MQ Interview Q&A (To Refresh / Boost our knowledge)

51. Tell me Some Channel Attributes?
Batch Heartbeat Interval (BATCHHB): This heartbeat interval allows a sending channel to verify that the receiving channel is still active just before committing a batch of messages. If the receiving channel is not active, the batch can be backed out rather than becoming in-doubt, Batch interval (BATCHINT), Batch size (BATCHSZ), Channel type (CHLTYPE), Cluster (CLUSTER), Cluster namelist (CLUSNL), Connection name (CONNAME),Convert message (CONVERT), Disconnect interval (DISCINT), Heartbeatinterval (HBINT), KeepAlive Interval (KAINT), Long retry count (LONGRTY), Long retry interval (LONGTMR), Maximum message length (MAXMSGL)
52. Why is Channel RETRYINT attribute used?
If a message is places in DLQ because of put inhibited or queue full condition, the DLQ handler attempts to put the message back to the destination queue. This interval is called as RETRYINT by default the retry interval is 60 seconds.
Receiver Cluster Receiver Requester
53. What is channel disconnect interval?
This is a time-out attribute, specified in seconds, for the server, cluster-sender, and cluster-receiver channels. The interval is measured from the point at which a batch ends, that is when the batch size is reached or when the batch interval expires and the transmission queue becomes empty. If no messages arrive on the transmission queue during the specified time interval,the channel closes down
54. Explain the channel attribute BATCHSIZE?
BATCHSIZE denotes the maximum number of messages that can be sent through a channel before taking a checkpoint. This parameter is valid only for channels with a channel type (CHLTYPE) of SDR, SVR, RCVR, RQSTR, CLUSSDR, or CLUSRCVR. The value must be in the range 1 through 9999.
55. What is BATCH HEARTBEAT INTERVAL?
Ans: The batch heartbeat interval allows a sending channel to verify that the receiving channel is still active just before committing a batch of messages, so that if the receiving channel is not active, the batch can be backed out rather than becoming in-doubt, as would otherwise be the case. By backing out the batch, the
messages remain available for processing so they could, for example, be redirected to another channel.
56. What is Keep Alive Interval?
Ans: The Keep Alive Interval parameter is used to specify a time-out value for a channel. The Keep Alive Interval parameter is a value passed to the communications stack specifying the Keep Alive timing for the channel. Itallows you to specify a different keep alive value for each channel. The value indicates a time, in seconds, and must be in the range 0 to 99999.
57. What is LONG Retry count?
Ans: Specify the maximum number of times that the channel is to try allocating a session to its partner. If the initial allocation attempt fails, theshort retry countnumber is decremented and the channel retries the remaining number of times.
58. What are the ways to start a channel?
Use the MQSC command START CHANNEL
Use the control command runmqchl to start the channel as a process
Use the channel initiator to trigger the channel
Type of channel states:
Inactive and Current- Stopped, Starting, Retrying and Active
59. What are the three options for stopping channels?
QUIESCE FORCE TERMINATE
60. What are the components of message channel?
A queue manager to communicate with another queue manager uses message channel. The components of a message channel are
1. Sender Message channel agent: Sender MCA is a program that transfers messages from a transmission queue to a communication link
2. Receiver MCA: It transfers messages from the communication link into the target queue
3. Communication protocol: Responsible for transferring messages A message channel is unidirectional.

Ans:
 A message channel agent (MCA) is a program that controls the sending and receiving of messages. There is one message channel agent at each end of a channel. One MCA takes messages from the transmission queue and puts them on the communication link. The other MCA receives messages and delivers them onto a queue on the remote queue manager.
A message channel agent is called a caller MCA if it initiated thecommunication; otherwise it is called a responder MCA.
62. What is Channel initiator and Listeners?
Ans: A channel initiatoracts as a trigger monitorfor sender channels, because a transmission queue may be defined as a triggered queue. When amessage arrives on a transmission queue that satisfies the triggering criteria for that queue, a message is sent to the initiation queue, triggering the channel initiator to start the
appropriate sender channel. You can also start server channels in this way if you specified the connection name of the partner in the channel definition. This means that channels can be started automatically, based upon messages arriving on the appropriate transmission queue.
You need a listenerprogram to start receiving (responder) MCAs. Responder MCAs are started in response to a startup request from the caller MCA; the channel listener detects incoming network requests and starts the associated channel.
63. What are Errors which cause the channel to go into re-trying state?
Due to: 1. Xmitq is set to get disabled
2. Network Issues
3.QueueManager Stopped
4. Listener is not running
5.TriggerTurned Off
64. Explain Channel-Exit programs and what are the types?
Channel-exit programs are called at defined places in the processing carried out by MCA programs
Security Exit: You can use security exit programs to verify that the partner at the other end of a channel is genuine
Message Exit: Message Exit can be used for Encryption on the link, messagedata conversion, validation of user ID,
Message-retry Exit: Message-retry exit is called when an attempt to open the target queue is unsuccessful
Sender and receiver Exit: You can use the send and receive exits to perform tasks such as data compression and decompression
Channel auto-definition ExitTransport-retry Exit
65. What is the Different Logging Methods available?
Ans: There are two different types available
1. Circular: The circular logging is used for restart recovery. It is the default logging method. Circular is used in Development and Testing Queues. Circular logging keeps all restart Data in a ring of log files. Logging fills the first file in the ring, then moves on to the and so on, until all the files are full. It then goes back to the first file in the ring and starts This continues as long as the product is in use, and has the advantage that you never run out of log files.
2. Linear: Linear logging gives you both restart recovery and media recovery. It is used in Production. Linear logging keeps the log data in a continuous Sequence of files. Space is not reused, so you can always retrieve any record logged from the time that the queue manager was created. As disk space is finite, you might have to think about some form of archiving. It is an administrative task to manage your disk space for the log, reusing Or extending the existing space as necessary.
66. What is the Default location where the logs are stored and mention the default sizes?
Ans: Default location:
Windows: C:Program FilesIBMWebSphere MQlogqmgr
UNIX: /var/mqm/log
67. What is the log file size?
Ans: In Web Sphere MQ for Windows NT and Win 2000, the minimum value is 32, and the maximum is 16 384. The default value is 256, giving a default log size of 1 MB.
In Web Sphere MQ for UNIX systems, the minimum value is 64, and the maximum is 16 384. The default value is 1024, giving a default log size of 4 MB.
68. How will you change the log file size?
Ans ; You cannot change the log file size. For this you need to drop and re-create the queue manager. The number of log files primary & secondary can be changed but you need to restart the Q manager for the changes to take effect.
69. what is the number for log primary and secondary file allocated?
Ans: Primary log files: The number of primary log files to be allocated is 3 by default the minimum is 2 and MAX in Win 253 / Unix 510
Secondary log files: The number of secondary log files to be allocated is 2by default the minimum is 1 and MAX in Win 252 / Unix 509
70. What is the command used for creating the listener?
Ans: crtmqlsr -t tcp -m QMNAME -p portno
71. What is the commands used for running listener in 5.3 Version?
Ans: runmqlsr -t tcp -m QMNAME -p portno
72. What is command used to perform task on the MQ services?
Ans: amqmdain
73. What are commands used on the Command server?
Ans: 1.strmqcsv: to start the command server
2. dspmqcsv: to display the command server
3. endmqcsv: To end the command server.
74. Is there is any chance for the Message lost?
Ans: If the target queuemanager doesn.t contain the dead letter queue defined and if the messages are running on a fast channel and of non persistant,Then there is a chance of the message loss.
75. What is the command that is used to provide authorization for the clients?
Anssetmqaut -m QMName -t queue -n Queuename -p GUEST +all
What are the common errors u get in DQM? Explain how to resolve ?
Ans: mqrc 2058: MQRC_Q_MGR_NAME_ERROR
Mqrc 2059: MQRC_Q_MGR_NOT_AVAILABLE.
Mqrc 2033: MQRC_NO_MSG_AVAILABLE.
Mqrc 2085: MQRC_UNKNOWN_OBJECT_NAME.
Mqrc 2009: MQRC_CONNECTION_BROKEN.
Mqrc 2043: MQRC_OBJECT_TYPE_ERROR.
Mqrc 2086: MQRC_UNKNOWN_OBJECT_Q_MGR.
Mqrc 2035: MQRC_NOT_AUTHORIZED.
76. What are different modes in which a application can connect to a Queuemanager?
Ans: 1.Binding mode: In binding mode, also known as server connection, the communication to the queue manager utilizes inter-process communications. One of the key factors that should be kept in mind is that binding mode is available only to programs running on the MQSeries server that hosts the queue manager. A program using binding mode will not run from an MQSeries client machine. Binding mode is a fast and efficient way to interact with MQSeries. Certain Facilities, such as XA transaction co-ordination by queue manager, are available only in binding mode.
2. Client Connection: Client connection uses a TCP/IP connection to the MQSeries Server and enables communications with the queue manager. Programs using client connections can run on an MQSeries client machine as well as on an MQSeries server machine. Client connections use client channels on the queue manager to communicate with the queue manager. The client connection does not support XA transaction coordination by the queue manager.
77. What are the different types of messaging systems used by JMS?
Ans: JMS applications use either the point-to-point (PTP) or publish/subscribe style of messaging.
Point-to-Point: Point-to-point messaging involves working with queues of messages. The sender sends messages to a specific queue to be consumed normally by a single receiver. In point-to-point communication, a message has at most one recipient. A sending client addresses the message to the queue that holds the messages for the intended (receiving) client.
Publish/Subscribe: In contrast to the point-to-point model of communication, the publish/subscribe model enables the delivery of a message to multiple recipients. A sending client addresses, or publishes, the message to a topic to which multiple clients can be subscribed. There can bemultiple publishers, as well as subscribers, to a topic.
78. Is It Possible to use one transmission Queue for the multiplemessage channels?
Ans: It is possible to define more than one channel per transmission queue, but only one of these channels can be active at any one time. This is recommended for the provision of alternative routes between queue managers for traffic balancing and link failure corrective action. A transmission queue cannot be used by another channel if the previous channel to use it terminated leaving a batch of messages in-doubt at the sending end.
79. What is the command used to test whether the channel is active or not?
Ans: runmqsc QMName
Ping channel (channel name).
80. What are the administrative commands that are used in Publish and Subscribe?
Ans: The strmqbrk command is used to start a broker. The first time thiscommand is run on a queue manager, all the relevant MQSeries objects areautomatically created.
——–strmqbrk -m MYQMGRNAME
The dspmqbrk command is used to check the status of the broker. Possible states are: starting, running, stopping, quiescing, not active and ended abnormally.
——–dspmqbrk -m MYQMGRNAME
The endmqbrk command is used to stop a broker. There are two options: -crequests a controlled shutdown (default), -i requests an immediate shutdown.
——-endmqbrk -i -m MYQMGRNAME
81. What is multiple hoping or Concept of Hop-through?
Ans: If there is no direct communication link between the source queue manager and the target queue manager, it is possible to pass through one or more intermediate queue managers on the way to the target queue manager. This is known as a multi-hop.
82. What is Local administration and Remote administration?
Local Administration: Means carrying out administration tasks on any queue managers you have defined on your local system.
Remote Administration: This allows you to issue commands from your local system that are processed on another system. For example, you can issue a remote command to change a queue definition on a remote queue manager. You do not have to log on to that system, although you do need to have the appropriate channels defined. The queue manager and command server onthe target system must be running
83. Difference between Control Commands used in Windows and other Os?
Control commands on are case sensitive other OS but Windows they can be used any way.
84. What is MQOO_BIND_ON_OPEN option on the MQOPEN call ?
When this attribute is set it forces all the messages sent to this queue to be sent to the same instance of the queue (go to the same queue in cluster)
85. Difference between MQPUT and MQPUT1 call ?
The MQPUT1 call always operates as though MQOO_BIND_NOT_FIXED were in effect, that is, it always invokes the workload management routine.
86. When is Channel security exit program called?
Are called at MCA initiation and termination
Stopping unauthorized queue managers putting messages on your queues
Use OS security, Object Authority Manager (OAM) on WebSphere MQ user-written procedures
87. What happens if DEAD letter Queue is not defined?
If dead letter queue are not defined the Messages are placed on the Transmission Queue and the Queue Manager become Inactive
88. Explain Remote queue definitions? Advantages?
These are definitions for queues that are owned by another queue manager
Advantages: The advantage of remote queue definitions is that they enable an application to put a message to a remote queue without having to specify the name of the remote queue or the remote queue manager, or the name of the transmission queue. This gives you location independence.
89. What happens if channel terminates when fast non-persistent messages are in transit?
If a channel terminates while fast, non-persistent messages are in transit,the messages are lost and it is up to the application to arrange for their recovery if required. If the receiving channel cannot put the message to its destination queue then it is placed on the dead letter queue, if one has been defined. If not, the message is discarded.
90. What happens when a message cannot be delivered?
Message-retry: If the MCA is unable to put a message to the target queue for a reason that could be transitory (for example, because the queue is full), the MCA has the option to wait and retry the operation later
Return-to-sender: If message-retry was unsuccessful, or a different type of error was encountered, the MCA can send the message back to the originator
Dead-letter queue: If a message cannot be delivered or returned, it is put on to the dead-letter queue (DLQ). You can use the DLQ handler to process the message
Recovery scenario –Disk Drive Full, damaged Queue manager object, Damaged single object, Automatic media recovery failure
MQ ensures that messages are not lost by maintaining records (logs) of the activities of the queue managers that handle the receipt, transmission, and delivery of messages
91. How to Process Messages from the Dead-letter-Queue?
We can Process the DLQ messages using runmqdlq command for sending messages to the destination Queues or target Queues. Use the runmqdlq command to start the dead-letter queue (DLQ) handler, which monitors and handles messages on a dead-letter queue.
runmqdlq QName QMgrName
Use the Dead-Letter-Queue-Handler to perform various actions on selected messages by specifying a set of rules that can both select a message and define the action to be performed on that message.
The runmqdlq command takes its input from stdin. When the command is processed, the results and a summary are put into a report that is sent to stdout.
92. Which field of the MQDLH structure contains a reason code that identifies why the message is on the DLQ?
Reason field
93. What is completion code(MQCC) and reason code(MQRC)?
Completion code gives the status of the current transaction it can be 0, 1, 2. 0- for Successful completion (MQCC_OK), 1- Warning (MQCC_WARNING), 2- call failed (MQCC_FAILED). Reason code is that which gives the reason for which the transaction fails it can be MQRC_NONE, MQRC_BACKED_OUT etc.
94. What is Correl ID?
This is a byte string that the application can use to relate one message to another, or to relate the message to other unit of work that the application is performing. The correlation identifier is a permanent property of the message, and persists across restarts of the queue manager
95. Explain commit and Back Out units of work?
When a program puts a message on a queue within a unit of work, that message is made visible to other programs only when the program commits the unit of work.
Commit: To commit a unit of work, all updates must be successful to preserve data integrity. If the program detects an error and decides that the put operation should not be made permanent, it can back out the unit of work.
Back Out: When a program performs a back out, WebSphere MQ restores the queue by removing the messages that were put on the queue by that unit of work. The way in which the program performs the commit and back out operations depends on the environment in which the program is running
96. What is BackoutCount (MQLONG)?
This is a count of the number of times that the message has been previously returned by the MQGET call as part of a unit of work, and subsequently backed out. BackoutCount is the number of times the application tried and failed to put the messages in the Queue
97. What is segmentation and explain segmentation Flag?
When a message is too big for a queue, an attempt to put the message on the queue usually fails. Segmentation is a technique whereby the queue manager or application splits the message into smaller pieces called segments, and places each segment on the queue as a separate physical message. The application that retrieves the message can either retrieve the segments one by one, or request the queue manager to reassemble the segments into a single message that is returned by the MQGET call.
98. What are Namelist? when do you use it?
A namelist is a WebSphere MQ object that contains a list of other WebSphere MQ objects. Typically, namelists are used
àBy trigger monitors, where they are used to identify a group of queues.
àNamelists are also used with queue manager clusters to maintain a list of clusters referred to by more than one WebSphere MQ object.
àThe advantage of using a namelist is that it is maintained independently of applications; it can be updated without stopping any of the applications that use it. Also, if one application fails, the namelist is not affected and other applications can continue using it. Namelists are also used with queue manager clusters to maintain a list of clusters referred to by more than one WebSphere MQ object
99. What are name services?
The name service is an installable service that provides support to the queue manager for looking up the name of the queue manager that owns a specified queue.
100. What is Local units of work (uses a single-phase commit process) and Global unit of Work (uses a two-phase commit process)?
Local unit of work: Units of work that involve only the queue manager are called local units of work. Syncpoint coordination is provided by the queue manager itself (internal coordination) using a single-phase commit process.
Use global units of work when you also need to include updates to resources belonging to other resource managers. Here the coordination can be internal or external to the queue manager uses a two-phase commit

Comments