Hi Tom,
I don’t know if this will help you, it’s something we have implemented.
We have lots of different types of request for one of our backend systems, which all go onto the same queue. We tag each item with the type of request. We have one process which runs on 10 VMs to process that queue.
At different times of the day, we wanted to vary what request types got processed first, so have an environment variable which holds multiple lines in the format:
Time,VM,Tag(s)
i.e.
21:00:00,VW003161,+Urgent|+GPP Application Setup|+TVI|-Background Batch
21:00:00,VW003164,+Urgent|+GPP Application Setup|+TVI|-Background Batch
21:00:00,VW003165,+Urgent|+GPP Application Setup|+TVI|-Background Batch
16:00:00,VW003161,+Urgent|+Settlement Process; -Authorise Settle Policy|-Authorise Settle Policy
The processing looks down these lines until it finds one where the current time is after the time specified and the machine matches the machine the process is running on. Then it splits out the tags field by ‘|’ and does a get next item using those tags until it returns an item. So using the above lines, if the time was 16:25 and we were running on VW003161, it would:
Get Next Item with tag ‘+Urgent’. If an item was found then process, otherwise
Get Next Item with tag ‘+Settlement Process; -Authorise Settle Policy’. If an item was found then process, otherwise
Get Next Item with tag ‘-Authorise Settle Policy’. If an item was found then process, otherwise continue with no item found processing
The environment variable is copied to a session variable at the start of the process, so we can change it on the fly.