Configure a message flow to write details of a
connection closure to a file, by the use of TCPIPServerInput, Compute, and FileOutput or FTEOutput nodes.
About this task
Scenario: A message flow writes close connection
details to a file. The scenario uses the FileOutput node; the steps
shown also apply to the FTEOutput node.
Instructions The
following steps show how to configure a message flow to write details
of the closure of any connection to a file:
Procedure
- Create a message flow called TCPIP_Task15 with
a TCPIPServerInput node,
a Compute node, and a FileOutput node.
- Connect the Close terminal of the TCPIPServerInput node to the
In terminal of the Compute node.
- Connect the Out terminal of the Compute node to the In terminal
of the FileOutput node.
- On the TCPIPServerInput node,
set the Connection details property
(on the Basic tab) to 14155.
- On the Compute node,
set the ESQL property (on
the Basic tab) to:
BROKER SCHEMA Tasks
CREATE COMPUTE MODULE TCPIP_Task15_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
Set OutputRoot.XMLNSC.CloseEvent = InputLocalEnvironment.TCPIP;
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
- Set the following properties of the FileOutput node.
- On the Basic tab, set the following
properties:
- Set the Directory property
to c:\temp\Task15.
- Set the File name or pattern property
to CloseEvents.txt.
- On the Records and elements tab,
set the Record definition property
to Record is unmodified data.
- Save the message flow.