March 10, 2014
By John Sperle
What is Async & What are Queues?
Async Framework is a service used for asynchronous execution of business logic.
In Infor Landmark Technology Runtime, the AsyncFramework can be used to execute Set Actions, Instance Actions, Batch Tasks and Batch Task Streams – henceforth referred to as tasks in this document. It also handles executing system requests such as Infor Lawson Transactions, E-Mail and Infor M3 Transactions (future).
In addition to asynchronous execution, the Async Framework provides scheduled execution of tasks. By scheduling any of these items, you may specify when in the future you would like the task to be executed and if you want it to be repeated several times e.g. every Monday.
Async Framework has two main use case scenarios:
- The end user that would like to execute some task or set of tasks asynchronously
- The system administrator that wants to manage system resources
All actions go through a queue. Queues are a mechanism to manage system resources in the Infor Landmark Technology Runtime engine. There are a few system queues, and associated mappings, that are delivered with an Infor Landmark Technology Runtime installation. These delivered queues should not be used for any other purpose. These are:
- Infor Lawson
- Infor M3
- Web Service (WS)
In addition to these system queues, an Infor Landmark Technology Runtime System Administrator can create as many other queues as they need. (See the section below titled “Creating a Queue”). Each queue operates independently of others so some care must be taken to ensure system resources are used wisely.
By default, if no queue is found for an action, it is routed to the Default Queue – which is created upon its first reference. Currently, when the default queue is created, it defaults to allowing only one action to run from that queue at a time (it used to default to five (5) and may be set as such if it was created before the change). They can change this value to suit their needs and tune their system. The default of one (1) is very safe but also does not allow for quick execution of numerous actions. I would expect most customers would use the default queue for most things and set up special queues for heavy hitting actions or cases where they want additional control.
Creating a Queue
Give it a name and description. The queue below has been defined to allow only one action from this queue to be active at a time. It has also been created as “Suspended” so no jobs will currently execute from it. They will be placed in the queue and held. You can optionally “Save History.” The default is for each Trigger (each individual execution of a schedule) to delete itself upon successful completion. If no additional schedules are left, the request also deletes. Saving History will hang onto these. They tend to pile up so this is usually only used for temporary purposes so people can verify things ran. You will never want to check the “System Queue” box. This is for internal queues as mentioned at the top of this article.
Create a Queue Mapping
Creating a queue mapping is what causes an action to route to a queue: You have several options for filtering an action into a queue. This example is fairly specific but does not go so far as to route based on an actor. Several different mappings can be created to route to the same queue. Thus multiple actions can be routed to the same queue, or you can even route the same action but say, specify an Actor, and change the priority of the action based on the Actor ID. I.E. Jane has a higher priority than Jeff. You can also override the “Save History” by Mapping so only certain actions routing to a queue keep their history. Let’s say you only have the Default Queue and everything goes through it. Jeff complains his jobs are not getting done. You don’t want to save history for everybody’s actions because that’s a lot of volume. You could create a Queue Mapping for Jeff that routes to the Default Queue but specifies “Save History” so you can see what’s going on. You will likely never need to fill in the “Log Producer Name”. This is mainly used for the system queues.
The Mapping Field 1 and 2 fields are available based on the version of the Infor Landmark Technology Runtime being used, thus these may or may not be present.
In versions where available, these are used to further narrow criteria for mapping. For example, when generating a PDF for a list, form or page, the Class and Action field are fixed and always the same for all (ReportDocument.Create). The Mapping fields will contain the target business class and list or form for form generation and the Page name for page generation. Another example is scheduling an Infor Process Automation flow or service from the PfiTrigger business class. In this case, the service or flow name will be used.
If you go to the Queue list and choose the Actions drop down, you will see “Suspend Queue” and “Resume Queue” Set Actions. Running these actions allows you to select a Queue and make a schedule to perform it – say suspend at 7 am and resume at 7 pm. Do not confuse these actions with the “Suspend” and “Resume” actions. Those are for the currently selected record and apply immediately – not scheduled. “Suspend Queue” and “Resume Queue” are available even if no record is selected, the others are not. You can see there is also a “Set Max Active Actions For Queue” that can be scheduled. Thus you could create a schedule that throttles the max actions to 1 at 7 am and back up to 5 at 7 pm. This way you still get some throughput but don’t cripple the system during the day. At night, when there is a lighter load, you could ratchet it up.
You can manage the processing load for your system so that jobs finish in a timely manner and the system as a whole has the necessary resources available at all times for both foreground and background processing. To find out more about controlling the Async Framework Components and Async Overview applications, please see the Landmark administration guides to get information on utilities that can be used for monitoring and managing these queues. They are delivered and accessed as an online help Infocenter for your Landmark environment. Reference:
- Infor Landmark Technology Server Setup and Maintenance Guide
- Async Framework and Queue Management Overview
- Infor Landmark Technology Utilities Reference Guide
- Landmark Utility Syntax and Usage
Interested in getting training on this topic? There are two sites you may be interested in:
- Stay up to date on all of the training opportunities available on the Infor Learning Blog
- Visit the Infor Education Resources Center to find the latest global public schedule, general education catalog and all course catalogs. The course that covers this topic and many other Infor Landmark administration areas is Lawson: Administering Landmark Technology Runtime.