Background
I have an issue where roughly once a month the AIFQueueManager table is populated with ~150 records which relate to messages which had been sent to AX (where they "successfully failed"; i.e. errorred due to violation of business rules, but returned an exception as expected) over 6 months ago.
Question
What tables are involved in the AIF inbound message process / what order to events occur in? e.g. XML file is picked up and recorded in the AifDocumentLog, data's extracted and added to the AifQueueManager and AifGatewayQueue tables, records from here are then inserted in the AifMessageLog, etc.
Thanks in advance.
There are 4 main AIF classes, I will be talking about the inbound only, and focusing on the included file system adapter and flat XML files. I hope this makes things a little less hazy.
AIFGatewayReceiveService
- Uses adapters/channels to read messages in from different sources, and dumps them in the AifGatewayQueue tableAIFInboundProcessingService
- This processes the AifGatewayQueue table data and sends to the Ax[Document] classesAIFOutboundProcessingService
- This is the inverse of #2. It creates XMLs with relevent metadataAIFGatewaySendService
- This is the inverse of #1, where it uses adapters/channels to send messages out to different locations from the AifGatewayQueueFor #1
So #1 basically fills the AifGatewayQueue
, which is just a queue of work. It loops through all of your channels and then finds the relevant adapter by ClassId. The adapters are classes that implement AifIntegrationAdapter
and AifReceiveAdapter
if you wanted to make your own custom one. When it loops over the different channels, it then loops over each "message" and tries to receive it into the queue.
If it can't process the file for some reason, it catches exceptions and throws them in the SysExceptionTable
[Basic>Periodic>Application Integration Framework>Exceptions]. These messages are scraped from the infolog, and the messages are generated mostly from the receive adaptor, which would be AifFileSystemReceiveAdapter
for my example.
For #2
So #2 is processing the inbound messages sitting in the queue (ready/inprocess). The AifRequestProcessor\processServiceRequest
does the work.
From this method, it will call:
Classes\AifMessageManager
, which puts records in the AifMessageLog
and the AifDocumentLog
.responseMessage = AifRequestProcessor::executeServiceOperation(message, endpointActionPolicy);
which actually does the operation against the Ax[Document] classes by eventually getting to AifDispatcher::callServiceMethod(...)
responseMessage
and returns that where it may be logged. It also takes that return value, and if there is a response channel, it submits that back into the AifGatewayQueueAifQueueManager
is actually cleared and populated on the fly by calling AifQueueManager::createQueueManagerData();
.