This topic explains how to specify tags for tasks.
Use cases
You can specify tags for tasks in scenarios such as canary releases and stress testing. For example, within the same Application Group, you may want to use a subset of instances for these activities. These instances might run a different task implementation class than other production instances. During task scheduling, instances are randomly selected. If a canary task is assigned to a regular instance, the system may fail to find the required implementation class.
Traditional solutions
Traditional solutions often involve creating multiple Application Groups. For example, you might create a separate group with a unique Group ID just for canary instances. However, this approach has the following limitations.
-
Because canary tasks typically handle low traffic, dedicating instances solely for them wastes resources.
-
After you test and approve the canary task, you must deploy it to all production instances. However, because the task is configured in the canary group, you must recreate the task in the main production group and then delete the original canary task.
Tag-based solution
You can specify tags when you register a SchedulerX client. The following example shows the configuration for a Spring Boot integration. For more information, see Integrate SchedulerX with a Spring Boot application.
spring.schedulerx2.label=gray
Step 1: Verify tag registration
Log on to the MSE SchedulerX console.
-
In the top navigation bar, select a region.
-
In the navigation pane on the left, click Application Management.
-
On the Application Management page, click View Instances in the Actions column. On the Connect to an instance page, check the Tag column to verify that the tag was registered successfully.
Step 2: Assign the task by tag
Log on to the MSE SchedulerX console.
-
In the top navigation bar, select a region.
-
In the left navigation pane, select Task Management.
-
On the Task Management page, find the target task, click More in the Actions column, and then select Specify machine.
-
On the Specify machine page, set Type to Tag, select the checkboxes for the corresponding instances, and then click OK.
After you validate the canary release, deploy the new task implementation class to all instances. You can then remove the tag assignment to apply the changes dynamically.