Assign task to a specific Back4 server

Build 1501 on 14/Nov/2017  This topic last edited on: 8/Jun/2015, at 08:29

You may have multiple Back4 services running on different servers and executing scheduled tasks - and so dividing the load. In an environment with a lot of scheduled activities, some of which can even depend on particular third-party software installed on the servers (e.g. Pit Stop) it is useful to specify which server should execute a specific scheduled task.

Example

Let us assume you have two Back4 servers (Back4A and Back4B)

First, add two profiles in the Back4 server configuration: srv_Back4A and srv_Back4B.

To test it, do publish with one server and unpublish with another one:

Publish object 158108 to the pubdest /GNWeb/News using server Back4A:

cmd4 schedpublish -profile srv_Back4A -pubcmd aids:158108 -pubdest /GNWeb/News -username stefano -password ***** 

Unpublish object 158108 from the pubdest /GNWeb/News using server Back4B:

cmd4 schedpublish -profile srv_Back4_2 -pubcmd rids:158108 -pubdest /GNWeb/News -username stefano -password ***** 

How to check which server performs which task?

You can check what's happenning by running the http://youservername/int/do.ashx?cmd=tasks in a browser to check the Back4 tasks so you can get the result below where you can see where tasks run.

<TaskDesc xsi:type="ObjsWFTaskDesc" Id="259007" execSpan="123" userId="4" priority="0" execProc="\\GFRMGN4BACK4P\Tera Back4" execTime="2014-06-17T19:57:37.663Z" type="ObjsWF" objectId="6745538" profile="TARK4" numRetries="0"scheduledTaskRef="0" ids="12674918"/>

<snip>

<TaskDesc xsi:type="ObjsWFTaskDesc" Id="259020" execSpan="115" userId="4" priority="0" execProc="\\GFRMGN4BACK4E\Tera Back4" execTime="2014-06-17T19:57:46.067Z" type="ObjsWF" objectId="6745538" profile="TARK4" numRetries="0"scheduledTaskRef="0" ids="12674852"/>

How to handle tasks from within a workflow?

Add the server name to the all ScheduleWorkflow settings in the running workflow, e.g. in the wf_Import_Tark.xml, in the following format:

<ScheduleWorkflow 

 x:Name="scheduleImagePreview" 

 Profile="srv_BACK4SERVERNAME

 Priority="0" 

 WFName="CreatePreviewThumbnailImageIds" 

 ObjIds="{wf:ActivityBind importImage, IdsOut}" 

 Description="Scheduling the creation of the image thumbnail and preview..." 

/>

The BACK4SERVENAME is the server name. If your server name is GFRMGN4BACK4P, then the string should be srv_GFRMGN4BACK4P.