Flow Run by Message Queue Monitoring
By monitoring the specified message queue in the JMSQueue system, once the message is received, the Flow will run.
Flow
To create the Flow run by message queue monitoring, you should start it with a Start Component, and finish it with an End Component.
Create the Flow
To create it, you can click the "Text Processing Flow" icon under the "Flow" tab in the "Create Flow" dialog box. In the created Flow, the settings for supporting mail monitoring execution have completed.
- Flow property
- Initial status
- The Flow variables as below has been set.
- Variable name is JMSDestination. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSDeliveryMode. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSMessageID. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSTimestamp. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSExpiration. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSRedelivered. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSPriority. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSReplyTo. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSCorrelationID. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is JMSType. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Component
- A Start Component has been put.
- Output stream type is Text.
- A Start Component has been put.
Start (Input stream)
Flow's input stream is Start Component's output stream. You can click Start Component to open a stream pane, and define the stream there. In the Flow run by message queue monitoring, the JMSQueue system will decide output stream type according to the received message type.
| Output stream type | Received message type |
|---|---|
| XML | BytesMessage |
| CSV | BytesMessage/TextMessage |
| FixedLength | BytesMessage |
| ParameterList | BytesMessage/MapMessage |
| Text | BytesMessage/TextMessage |
| HTML | BytesMessage/TextMessage |
| Binary | BytesMessage |
| MIME | BytesMessage |
| Record | BytesMessage |
For example, the ParameterList Stream is only used when BytesMessage or MapMessage from JMSQueue System is received. Moreover, the data included in the BytesMessage must be decided. For example, for the XML Stream, the XML byte sequence must be included in the BytesMessage.
When the received message can't be changed into the Start Component's output stream type, the Flow can't run, and an error will happen. The error will be written into FlowService.log.
Flow parameter
Flow's parameter is a framework in which the value you want to set can be got from a caller by publishing the variable of the Flow you want to run. In the Flow run by message queue monitoring, by defining and publishing the Flow variables with the following decided names, the Flow Service will get a value automatically to set the Flow variable.
| Flow variable name to define | Got content |
|---|---|
| JMSDestination | Destination. |
| JMSDeliveryMode | Persistance flag. |
| JMSMessageID | Message identification. |
| JMSTimestamp | Time the message was sent. |
| JMSExpiration | Message's invalid period.(Mili seconds from January 1st, 1970). |
| JMSRedelivered | True if it's redelievered message. |
| JMSPriority | Message's priority. |
| JMSReplyTo | Any information which shows reply target. |
| JMSCorrelationID | Any identification. |
| JMSType | Any information. |
Finish(Output stream)
There is no output stream.
Execution setting
You can make a connection between Flow and interval to monitor JMSQueue System by execution setting. It's necessary to define the connection to the JMSQueue System previously.
Define execution setting
Click "Queue" in the Execution Setting dialog box or Trigger Management's tool bar. Then click "Select" in the right of the "Flow" under "Flow settings", and select a Flow from the dialog box. You can select a Queue connection name which has been created in the connection pane or the Manegement Console from the "Connectin name" pull-down list under "Message queue settings".
Define connection to the JMSQueue System
In the Flow Designer, click "Create connection" in the connection pane's tool bar and open a dialog box. Next, select "Queue" from the "Connection type"'s pull-down list, and enter a name into the "Name" field. Then enter a JNDI connection name, queue name and user name etc. into the inspector and save them. Saved connection will be shown in the "Connection name"'s pull-down list in the execution settings.
※It 's necessary to define JNDI connection previously.