This topic describes how to use an SDK to quickly integrate a Golang application with SchedulerX.
Console configuration
Create a common application as described in Create Application and generate configuration information as described in Step 2.
endpoint=xxxx namespace=xxxx groupId=xxx appKey=xxxCreate a Golang task as described in Task Management.

Client integration
Run the following command to pull the Go SDK.
go get github.com/alibaba/schedulerx-worker-go@{latest_tag}Write your business code to implement the
Processorinterface.type Processor interface { Process(ctx *processor.JobContext) (*ProcessResult, error) }Example:
package main import ( "fmt" "github.com/alibaba/schedulerx-worker-go/processor" "github.com/alibaba/schedulerx-worker-go/processor/jobcontext" "time" ) var _ processor.Processor = &HelloWorld{} type HelloWorld struct{} func (h *HelloWorld) Process(ctx *jobcontext.JobContext) (*processor.ProcessResult, error) { fmt.Println("[Process] Start process my task: Hello world!") // mock execute task time.Sleep(3 * time.Second) ret := new(processor.ProcessResult) ret.SetStatus(processor.InstanceStatusSucceed) fmt.Println("[Process] End process my task: Hello world!") return ret, nil }Register the client and job. Ensure that the task name is the same as the one configured in the console.
package main import ( "github.com/alibaba/schedulerx-worker-go" ) func main() { // This is just an example, the real configuration needs to be obtained from the platform cfg := &schedulerx.Config{ Endpoint: "acm.aliyun.com", Namespace: "433d8b23-xxx-xxx-xxx-90d4d1b9a4af", GroupId: "xueren_sub", AppKey: "xxxxxx", } client, err := schedulerx.GetClient(cfg) if err != nil { panic(err) } task := &HelloWorld{} // Name your task and register it with the client. The name must be the same as the one in the console. client.RegisterTask("HelloWorld", task) select {} }
Verify the result
Publish the application to Alibaba Cloud after the application is connected to SchedulerX.
Log on to the SchedulerX console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Application Management.
On the Application Management page, view Total number of instances.
If the Total number of instances column displays 0, the application is not connected to SchedulerX. In this case, check and modify the on-premises application.
If the Total number of instances column displays a number other than 0, the application is connected to SchedulerX. Click View instances in the Operation column to view the instances in the Connect to an instance panel.
What to do next
After the application is connected to SchedulerX, you can create jobs in the SchedulerX console. For more information, see the "Create a job" section of the Job management topic.