Modifying the JMS queue and database receiver to handle EOF messages

The messages received at the queue or the database is explained with the example.

Figure 1. Output messages created in the JMS queue or database
JMS Receiver Window
1. <Item YantraMessageGroupID="file1.txt.001" 
ItemID="Item1" Attr1="Value1" Attr2="Value2" Attr3="Value3"/>
/>
2. <Item YantraMessageGroupID="file1.txt.001"
ItemID="Item2" Attr1="Value1" Attr2="Value2" Attr3="Value3"
/>
<Item YantraMessageGroupID="file1.txt.001"
ItemID="Item3" Attr1="Value1" Attr2="Value2" Attr3="Value3"
/>
4. <EOF YantraMessageGroupID="file1.txt.001" ItemID="Item4"
Attr1="Value1" Attr2="Value2" Attr3="Value3" FileName=""
FileSize="" LastModifiedTime="" />
  1. Once the EOF is reached the messages received by the JMS queue or Database the framework checks whether the EOF has the same message group ID.
  2. You must configure the JMS queue or Database receiver component to enable a service to be invoked when the EOF message is received. If a service is not invoked then an exception is thrown.
  3. The yfs.eof.wait.time property can be configured in the <INSTALL_DIR>/properties/customer_overrides.properties file to set the maximum time, in seconds, after receiving an EOF message that the service configured to execute on EOF receipt will run. The default value is 300 seconds. If it is determined that all the records were processed before the yfs.eof.wait.time has passed after receipt of the EOF message, the service may be called earlier.

    In general, the XML file passed to the service must have a root node name as EOF. However, you can specify a custom root node name instead of EOF. This node name is specified in the JMS queue or Database receiver properties.

    For example, when you customize the root node name as Root Node Name Of EOF Message: NewRootNode and Service to execute on EOF Message: NewService, add the XML attributes that must be included in the input to the NewService with the with the MessageType value as "EOF" as follows:

    <EOF YantraMessageGroupID='123' />

    The input to the NewService would be constructed as <NewRootNode YantraMessageGroupID='123'/>

Error handling by integration server:

When an EOF file message reaches the integration server it is checked for any reprocessable messages for this service with the same YantraMessageGroupID. If there are any pending error messages to be reprocessed, then the EOF messages are marked as reprocessable. This error messages are then inserted into the YFS_REPROCESS_TABLE.