Message Processor can be described as a kernel of the IFS Connect framework. It is responsible for processing of all Application Messages.
Message Processor is a central part of the IFS Connect framework responsible for processing
of
Application Messages.
The process can involve both synchronous calls and background processing of
messages, both inbound and outbound. Message Processor can be called from
Batch
Processor,
Connect Reader framework and SOAP Gateway.
Message Processor will route the incoming application message if not already routed. A message is assumed to be routed if there are address lines on it. Message Processor will execute an outbound BizAPI, if defined, and process all address lines.
A new
Application
Message is created with state Released. As soon as
the message has been picked up for processing the state is changed to
'Processing'. It can be done by the Message Processor, but for outbound messages
created in an In-Parallel queue the state is changed already in the PL/SQL logic.
Message Processor will only process messages in 'Released' or 'Processing'
state.
A successfully executed message will get its state changed to 'Finished' (or
Waiting for scheduled job see
Scheduled Tasks). All address
lines on such message will then get state 'Transferred'.
Execution of an address line can fail in two ways: temporary or definitive failure.
A temporary failure sets address state to 'Retry', sets a retry counter on the address line to the value specified on corresponding Connect Sender configuration (on first failure) or decreases with one, creates a one-time scheduled task that will change message state to 'Released' after a period of time specified on the Connect Sender configuration and finally sets the state of the entire message to 'Waiting'. If there are several address lines ending up in state Retry, only one scheduled task will be created with the closest execution time. The creation of the task can be affected by the background job definition see Scheduled Tasks.
A permanent failure sets address state to 'Failed' and will cause the state of message to be eventually set to 'Failed' as well, but the logic will first try to resolve all address lines before setting the final state. No one-time scheduled task will be created for messages ending up in state Failed.
With other words as long as there are address lines with state 'Retry', the state of message will be 'Waiting'. If at least one address line will be in state 'Failed', the entire message will eventually also be marked as 'Failed'.
An Application Message can have following states:
State Canceled can only be entered manually in the client application.
A message created in a stopped queue will get state Suspended. It is also
possible to temporarily suspend a message manually in the client application.
Starting a stopped queue will automatically release all suspended messages in
this queue.
An address line (Address Label) can have following states:
Message processing can be trigged in the background from the Batch Processor or directly, from SOAP Gateway or Connect Reader framework. In the first case the message to be processed is already in state 'Processing' while in the second and third case the massage has not been persisted yet and is still in state 'Released'.
Note: for In-Order and In-Sequence queues the application message picked up by the Batch Processor is in state 'Released', but Batch Processor will change the state to 'Processing' before calling Message Processor. The state change is performed in a separate transaction. See also handling of Restricted Messages.
Message Processor performs following steps on an Application Message:
There are two types of messages: inbound and outbound. Message Processor doesn't make any difference between these two types. The only reason why the Application Message is stamped with the type flag is because of grouping of routing rules per type. On the other hand Routing Addresses can be treated as Inbound (BizAPI or PL/SQL), i.e. saving incoming data to the IFS Applications database, or Outbound (remaining types), i.e. sending the message outside of the IFS Applications.
Processing of a single address line consists of the following steps (see also How to create Destination Address):
UNKNOWN_XML
or NONE_XML
.UNKNOWN_XML
and NONE_XML
the entire message data will be
taken.Note that for binary data only transformation using binary Java transformers is possible.
Note that a failure during data sending will not guarantee data consistency - Message Processor doesn't implement two-phase commit and consequently doesn't know if the data at the receiving part has been processed correctly or not.
Note that internally all type of text data (plain text or XML) is always encoded in UTF-8 character encoding. Re-coding from/to another character set is done, if necessary, in Readers, when reading messages and Senders, when sending messages.
Note that if the output envelope defines the identification pattern for the response and the pattern will be found in the message, unsuccessful attempt to extract the body will lead to an error.
UNKNOWN_XML
or
NONE_XML
, the response will be enveloped in a simple, basic
SOAP envelope (only text data, i.e. plain text or XML).Following actions can be performed on an Application Message in the client application:
Typically an Application Messages has one message body with input data. Processing of address lines will cause creation of a new message body for each successfully executed address line with response from the corresponding Connect Sender (a reply body). Attribute AddressSeqNo on Message Body points out the corresponding address line (AddressLabel.SeqNo).
In some circumstances, for example some messages created from the printing framework, the message can contain several bodies with input data, but only one body is the main one. The other bodies are collected as attachments to the corresponding Connect Sender that can handle such, typically Mail Sender.
Note: In the rare situation when the message contains several input bodies, only the main body is used for routing and is, if necessary, re-coded to UTF-8, processed through an outbound BizAPI, transformed and enveloped. The other bodies remain untouched.
BizAPI and PL/SQL addresses are executed in a separate transaction. Also outbound BizAPIs are called in a separate transaction.