The invention relates to information technology, and more specifically to a message handling method and system.
A message handling system normally comprises a network of linked computers or a single processing resource such as a mainframe computer with different logical components. The role of a message handling system is to maintain one or more queues of messages, to receive messages, and to place each message on a queue. The system will run one or more program applications, which access the queues, taking the messages from the queues and processing them.
In this messaging environment, there may be a need to send messages that have the sole purpose of performing diagnostic duties. The problem with doing so is that in such cases the messages may be received by a processing application, which is not always desirable.
According to a first aspect of the present invention, there is provided a method of operating a message handling system comprising maintaining one or more queues, receiving messages, placing each message on a queue, running one or more applications which access each queue, detecting the receipt of a message with a predefined flag, and blocking at least one application from accessing the message with the predefined flag.
According to a second aspect of the present invention, there is provided a message handling system comprising one or more queue managers arranged to maintain one or more queues, to receive messages, and to place each message on a queue, and one or more applications arranged to access each queue, a queue manager being further arranged to detect the receipt of a message with a predefined flag, and to block at least one application from accessing the message with the predefined flag.
According to a third aspect of the present invention, there is provided a computer program product, on a computer readable medium, for operating a message handling system and comprising instructions for maintaining one or more queues, receiving messages, placing each message on a queue, running one or more applications which access each queue, detecting the receipt of a message with a predefined flag, and blocking at least one application from accessing the message with the predefined flag.
Owing to the invention, it is possible to be able to send messages that can perform diagnostic duties without the message being processed by a processing application. The message carries a predefined flag to identify that message as a diagnostic message.
In a first embodiment, the blocking of at least one application from accessing the message with the predefined flag is achieved by discarding the message with the predefined flag, prior to the message being placed on a queue. This can be considered to be a discard on anival strategy. In this embodiment, the message is permitted to flow through the messaging system as usual, but the message is discarded immediately before it is actually put onto the local queue (not a transmission queue). A confirmation of arrival may be generated to show that the message has reached its destination, but the fact that the message is not placed on the queue prevents any processing application from receiving the message.
In a second embodiment, the blocking of at least one application from accessing the message with the predefined flag is achieved by preventing the blocked applications from removing the message from a queue. This methodology is a discard on delivery. In this embodiment, the message is again permitted to flow through the messaging system, and this time it is also placed onto the local queue. The message is discarded at the point where a processing application performs a get operation on the queue which, had the message not been discarded, would have resulted in the processing application receiving the message. This second method may be used to confirm that an application is processing the queue.
For discard on arrival, the diagnostic message is not put by the queue manager to the local queue and is instead discarded. For discard on delivery, the queue manager discards the diagnostic message at the point where the processing application performs a get operation that would otherwise result in it receiving the message.
Advantageously, the step of maintaining one or more queues comprises maintaining an input queue for receiving messages and one or more application queues for each application to access. By providing at least two queues with separate functions, the management of the system is greatly simplified.
Preferably, the step of maintaining one or more queues includes maintaining a discard queue and the step of blocking at least one application from accessing the message with the predefined flag includes placing the message on the discard queue. By providing a discard queue and placing the diagnostic message on that queue rather than a delete discard, more detailed information is obtainable concerning the workings of the message handling system.
Embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:
A channel (130) may be present, and one or more message channel agents (MCAs 110, 111) are present on each queue manager. The MCAs are responsible for transferring messages from transmit queues on the sending queue manager QM1, to destination queues on the receiving queue manager QM2. Overall, the message handling system 10 is arranged to maintain the queues, to receive messages, and to handle the messages between the queues.
The message handling system 10 also includes one or more applications, which are arranged to access the output queue APPQ. The applications will acquire messages from the queue APPQ for the purpose of carrying out work, generated as a result of the contents of the message. For example, in a message handling system supporting a shopping website, a message may constitute an order from a customer, which will be accessed by an application handling finance details of customers, and so on.
In order to carry out diagnostic work on the message handling system, a message 14 is generated that includes a flag 16 to designate the message 14 as not being an ordinary message. The queue manager QM2 is further arranged to detect the receipt of any message 14 with the predefined flag 16. The detection of the diagnostic message 14 is used to block the applications from accessing the message 14 with the predefined flag 16. This prevents the applications from attempting to carry out any work on the message 14.
In the embodiment shown in
The MCA running on QM1 will handle the message 14 as if it is a standard message, at step 2 and will pass the message 14 (step 3) to the MCA running on the target queue manager QM2. However, the MCA running on QM2 will block the applications from accessing the message 14 by discarding the message 14 on arrival (step 4). This can be achieved in one of two ways. In the first way, the message 14 can be placed on a discard queue DLQ (step 5); in the second way, the message 14 can be simply discarded. The discarding comprises deletion from memory of the message 14.
In the embodiment of
An application 17, connects to the queue APPQ using the appropriate MQI verbs (120). Application 17 issues an MQGET call and at this point the queue manager QM2 checks the message 14 to determine whether predefined flag 16 is set. If the predefined flag 16 is not set, then the message 14 is delivered to application 17 as requested. If the predefined flag 16 is set, then the message 14 is discarded.
As in the first embodiment of the system 10, the message 14 will be (at step 5) either placed on a discard queue DLQ or the message 14 will be discarded directly by deletion from memory.
Diagnostic messages are primarily used to determine routing information for a message as it flows through a messaging system. This routing information will primarily comprise the location of the message as it flows through the messaging system, although timing data may also be of interest.
Number | Date | Country | Kind |
---|---|---|---|
0511921.9 | Jun 2005 | GB | national |