Start and stop the asynchronous AIF services

For Application Integration Framework (AIF) to begin sending and receiving documents for adapter-based exchanges, the four services that move documents through the queues must be running as batch jobs within Microsoft Dynamics AX:

  • AIFGatewayReceiveService - Communicates with the adapters, receiving messages from their external locations (channels) and bringing them into AIF by putting them in the AIF gateway queue.

  • AIFInboundProcessingService - Takes inbound messages received by AIF through the AIFGatewayReceiveService and then sends them to the correct Microsoft Dynamics AX document class (Ax<Document> class).

  • AIFOutboundProcessingService - Combines an outbound document from Microsoft Dynamics AX with the document metadata such as endpoint and channel information and creates a fully-formed AIF message. The service then sends the message to the AIF gateway queue where it is picked up by the AIFGatewaySendService.

  • AIFGatewaySendService - Communicates with the adapters and writes the messages to the correct external locations.

Until these batch jobs are started, no documents can be processed in adapter-based exchanges. Inbound documents do not enter your Microsoft Dynamics AX system and outbound documents accumulate in the AIF outbound processing queue.

Each of these AIF services is implemented as a task in a Microsoft Dynamics AX batch job. For more information about batch jobs, see "Processing batch jobs" in the Application and Business Processes Help.

You can create a single batch job to support both inbound and outbound processing tasks, or you can create multiple batch jobs to run on one or more computers, depending on your processing needs.

To start the services and allow AIF to begin processing documents from the queues, perform the following steps:

  1. Create a batch job.

  2. Add a task for each of the AIF queue processing services to the batch job.

  3. Start the batch job by changing the status to .

Follow these steps to create a batch job. For more information, see "Batch job (form)" in the Application and Business Processes Help.

  1. Click > > .

  2. On the form, press CTRL+N to add a new job.

  3. In the field, enter a text description for the batch job.

  4. In the field, click the calendar icon to select a date and time for the batch job to start processing.

  5. In the field on the tab, select how the batch job processing should be saved to the batch history:

    • - Saves a record to the batch history each time this batch job runs.


      If you have this set to always save batch job processing history and you have a high recurrence frequency set for the batch job, it could lead to a high volume of batch history records.

    • - Saves a record to the batch history only if an error occurs.

    • - Does not save a record to the batch history regardless of whether the batch job runs successfully or encounters an error.

  6. Press CTRL+S to save.

  7. Click to set how frequently the batch job should run.

Note   You cannot change batch information while the job is running or waiting to be run. You must change the batch status to before changing batch information.

After you create the batch job, you must add a task to the job for each of the AIF queue services. The services should run in a specific order depending on whether the document exchange is inbound or outbound.

  • Inbound - For inbound exchanges, the AIFGatewayReceiveService should run first followed by the AIFInboundProcessingService. This is because the AIFGatewayReceiveService retrieves the inbound message from the external location (channel) and puts it in the queue and the AIFInboundProcessingService processes the message. The AIFGatewayReceiveService and AIFInboundProcessingService services are responsible for bringing messages into AIF.

  • Outbound - For outbound exchanges, the AIFOutboundProcessingService should run first followed by the AIFGatewaySendService. This is because the AIFOutboundProcessingService processes the message and the AIFGatewaySendService sends it to the proper location (channel). The AIFOutboundProcessingService and AIFGatewaySendService services are responsible for sending messages out of AIF.

For more information, see "Batch tasks (form)" in the Application and Business Processes Help.

To add tasks for the AIF services to the batch job, follow these steps:

  1. Click > > .

  2. Select a job and click . This opens the form.

  3. Press CTRL+N to add a new task.

  4. In the field, enter a text description of the task.

  5. In the field, select the company for which the task will run.

  6. In the field, select AifGatewayReceiveService. This specifies that this task will run the receive service.

  7. Press CTRL+S to save.

  8. Repeat steps 3 through 7 and select AifInboundProcessingService in the field.

  9. Repeat steps 3 through 7 and select AifOutboundProcessingService in the field.

  10. Repeat steps 3 through 7 and select AifGatewaySendService in the field.

  11. Add the appropriate batch constraints to ensure that the services are processed in the correct order.

When you create a batch job, the status is by default. After you have added the tasks to the job, you must change the job status to to start the processing of the batch job tasks.

  1. Click > > .

  2. Select the batch job.

  3. Click > .

  4. In the form, select . The AIF services will now start processing.

The batch job status will change to when the batch job is running. To refresh the batch job form, press F5.

To stop processing of the batch job tasks, follow these steps.

  1. Click > > .

  2. Select the batch job.

  3. Click > .

  4. In the form, select . The AIF services will now stop processing.


You cannot change the status of the batch job while the batch job status is . You must wait until the status changes to or . Press F5 to refresh the batch job form and check the status.

Community Additions