documentation timer nodes - wordpress.com€¦ · step 3:-configure the mqget by giving some queue...

21
Documentation Timer Nodes 1

Upload: others

Post on 12-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Documentation

Timer Nodes

1

Page 2: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Table of Contents

1. OVERVIEW ..........................................................................................................................................................3

1.1 INTRODUCTION ................................................................................................................................................ 31.2 PURPOSE ......................................................................................................................................................... 31.3 SCOPE ............................................................................................................................................................. 3

2. HARDWARE & S/W REQUIREMENTS ............................................................................................................4

3. FUNCTIONALITY & SCENARIOS ...................................................................................................................4

3.1 ILLUSTRATION .................................................................................................................................................. 4 SCENARIO 1...................................................................................................................................... 4 SCENARIO 2...................................................................................................................................... 8 SCENARIO 3.....................................................................................................................................11 SCENARIO 4.....................................................................................................................................18

4. AUTHOR ............................................................................................................................................................ 21

2

Page 3: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

1. OVERVIEW

1.1 Introduction :

IBM WebSphere Message Broker introduces two new built-in nodes: TimeoutControland TimeoutNotification. These nodes enable you to initiate flows in Message Broker based ontime-related events, such as using the TimeoutNotification node and TimeoutControl Nodes.

1.2 Purpose:

Many a times we need to generate events at a specific time interval. e.g:

• Events might be generated periodically to monitor a system.• A system might request periodically for stock price information from another

system.Websphere Message Broker provides two inbuilt nodes for meeting such requirements.

These nodes are.• TimeoutNotification Node

• TimeoutControl Nodes

TimeoutControl Nodes:

This node can receive MQ timeout request messages. A timeout request message is anormal MQ message having timeout request details. These details can be in XML format or anyother format supported by the installed parser. The TimeoutControl node validates the requestmessage for the timeout request format, stores the message and propagates it unchanged to thenext node in the message flow.

TimeoutNotification Node:

The TimeoutNotification node would be the first node in a timer-controlled message flow.It has no In terminal, which is normally where we would place an MQInput, MqeInput,JMSInput or similar node in a message flow. A property of this node is its unique identifier a 1 to12 character label.

1.3 Scope:

To make a flow run hourly on the hour, you can use a UNIX cron job, which can providerich semantics to control job scheduling. If many flows have this requirement, maintenance ofthe crontab becomes burdensome. Using timeout nodes provides a flexible, self-containedmechanism to start a message flow.

3

Page 4: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

2. HARDWARE & SOFTWARE REQUIREMENTS

• Websphere Message Broker Toolkit 6.0 or later• Websphere Message Queue Explorer 6.0 or later

3. FUNCTIONALITY & SCENARIOS:

• Lets look into some of the Timer Scenarios.

Scenario 1: Triggering a flow that matches a system time and date.

This scenario is to trigger at a particular start time and start date.If the start time and start date match with the system time and date then the flow gets triggered. Below are the flows screen shots.

Step 1:The screen shot describes how the flow work.

In the above screen shot describes a basic flow that is StartDateStartTime.msgflow.In that flow the TimeoutControl node properties of UID set to myIdentity. Its value must be unique

4

Page 5: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

within the broker. This identifier must be the same for TimeoutNotification node with which this node needs to be paired up

Step 2:The screen shot describe properties of TimeoutNotification node

In the above screenshot TimeoutNotification property of UID set to myIdentity This andOperation mode set to Controlled property so that this node is paired with any pairedTimeoutControl nodes.

In this scenario first node we use MQinput node so with the use of MQtransport service get theTimeoutRequest message into input queue.

Step 3:Here is the Sample input:-

5

Page 6: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

where

• TimeoutRequest corresponds to the settings in the properties panel(InputRoot.XMLNSC.TimeoutRequest) for TimeoutControl Node.

• Action tag indicates that we want to SET (create) a new timeout request. Theother allowed action is CANCEL.

• Identifier Tag represents the name of the tag we specified.

• The StartDate is of the form "yyyy-mm-dd", and if the tag is omitted, defaults tothe current date.

• The StartTime can be an element of type "Time".

• In this example, a timeout event happens immediately, and then recurs every 5seconds (Interval) for a total of 2 times (Count).

• The IgnoreMissed flag indicates whether or not timer events that should haveoccurred while the broker was down (or the message flow containing theTimeoutNotification node was stopped) should be generated when the

message flow starts again.

• The AllowOverwrite flag indicates whether or not it is permissible to change thesettings of a timer while that timer is still active. An active timer is one which isstill producing timer events.

Once the input is given using MQInput node,it will be propagated to downstream nodes.

Step 4:Now deploy the flow into the Execution Group & we see that the flow started to executed

6

Page 7: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

TimeoutControl node validate the TimeoutRequest and check current time and date if it ismatched and sent to the control message to the TimeoutNotification node.

Step 5:Manually setting the system Time and date equal to startime interval of TimeoutRequestmessage.

Control message received by the TimeoutControl Node

7

Page 8: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Once the control message received by the TimeoutControl node then it starts the flow based onthe interval count.

So finally flow is triggering based upon the interval count. If the interval count is 'n' the flowruns 'n' of times.

Scenario 2: Triggering a flow once every week by using Timeout Notification Node in standalone node

There is little flexibility when we use a Timeout Notification node is used in a message flow. The node begins to trigger as soon as the flow has been deployed into the Execution Group, and the first timer event occurs as soon as the flow is deployed. You cannot stop the timer (short of stopping the containing flow itself), nor can you dynamically change the time interval until you stop debugging.

The screen shot describes a simple scenario in Standalone mode:-

Step 1:- Design the Message flow with some name and use the Timeout notification node,Compute node & MQOutput nodes & wire them as follows.

8

Page 9: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 2:- Configure the TimeoutNotification node with some unique Identifier name,Set the Transaction mode to Yes,Operation Mode to Automatic,Timeout Interval set in seconds.

Step 3:- Now deploy the flow into the Execution Group & we see that the flow started to executed.

Step 3:- Write the following code in Compute Node.

Step 4:- Now the flow is being propagated to downstream node.

Step 5:- For testing whether the flow will execute exactly at the same time next week,we shall change the time manually.

9

Page 10: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 6:- We are changing the time to exactly seven days forward in order to test the scenario.

10

Page 11: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 7 :- After changing the time,we can see the flow has started to trigger once again.

Step 8 :- Observe the change in date & time in the previous screen which got updated to the changed date.

Scenario 3: To schedule a timer to hit every hour on weekdays starting from Monday to Friday whileexcluding weekends (Saturday,Sunday).

Step 1:- Create a flow with the TimeoutNotification Node's output terminal being connected to Compute node.From the compute node wire it to TimeoutControl node.

Create another flow within the same environment using TimeoutNotification Node,Filter Node,Compute

11

Page 12: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

node & MQOutput node as shown below:-

Step 2 :- The Properties of the first TimeoutNotification node are as follows:-

Step 3 :- Write the following ESQL coding in the Compute node.

12

Page 13: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 4:- Configure the TimeoutControl(Hourly_ TimeoutControl) node as follows

Step 5:- Configure the TimeoutNotification node(Hourly_ TN) node as follows

Step 6 :- Notice that we have used the same Unique Identifier for both the TimeoutControl and TimeoutNotification node

13

Page 14: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 7 :- Write the following ESQL code in Filter node as follows

Step 8:- Wire the True terminal of filter node to a Compute node and write the following ESQL Code in the Compute node to capture the request as an output message & to create a new MQ Tree.

Step 9:- Finally specify some Queue name in the MQOutput node.

Step 10 :- Now in order to test the flow, just deploy the flow into the Execution group.

14

Page 15: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 11 :- The minute you deploy the flow,it takes that time as the starttime.From now the trigger will be executed once every hour.

15

Page 16: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 12 :- From now the flow checks for the Unique Identifier whether it matches with any of the TimeoutNotification node.If any matched ID is found,it will be routed towards that node.

Step 13 :- In the filter node,we have written some coding for excluding the execution of the flow on Saturdays & Sundays.

16

Page 17: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 14:- Check the Output in the MQOutput Node.

Step 15:- The Result when it is viewed using RFHUTIL will appear like this:-

17

Page 18: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Scenario 4: Using MQGet node in combination with TimeoutNotification node to wait for some ten messages that are already placed in MQGET node.

Step1:- Configure the flow using TimeoutNotification node,MQGet node,Compute node & MQOutput node as shown in the screenshot.

Step 2 :- Configure the TimeoutNotification Node as shown below:-

18

Page 19: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Step 3:- Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-

Step 4:- Specify some Queue name in the MQOutput Node.Now we shall test the flow.

Step 5:- Now put some ten messages in the queue specified in the MQGET node.Basically we have used MQGet node to retrieve the message that has already been placed in a queue.

same as in the above screenshot put some ten messages on the same queue

19

Page 20: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Similarly put the other eight messages on the queue

Step 6:- Now the flow will move towards the downstream nodes.

Step 7:- Check the result in MQOutput Node.

Step 8:- The result can be seen using RFHUTIL:-

20

Page 21: Documentation Timer Nodes - WordPress.com€¦ · Step 3:-Configure the MQGet by giving some Queue name.In the Compute node,write the below code:-Step 4:-Specify some Queue name in

Authors:

Ramakrishna Raju Tadi

Ajay Kumar Gurrala

Chandrasekhar Bandla

21