Hello,
We have several micro-services, accessed using grpc. Want to orchestrate these. Typical workflow has just a few activities. Trying the following, but looks like the grpc client object is not serializable?
workflow:
conn, err := grpc.Dial(address, grpc.WithInsecure())
c := svc1proto.NewSvc1Client(conn)
ao := workflow.ActivityOptions{
StartToCloseTimeout: 50 * time.Second,
ScheduleToCloseTimeout: 100 * time.Second,
}
ctx = workflow.WithActivityOptions(ctx, ao)
workflow.ExecuteActivity(ctx, activities.Activity1, nil, c).Get(ctx, nil)
activity:
func Activity1(ctx context.Context, c svc1proto.Svc1Client) error {
r, err := c.SvcMethod1()
…
return nil
}
In general, are there some best practices of how to structure the workflow/workers/activity code in go. Say we have 50+ services, accessed using grpc, each workflow typically calls 5 or so activities, and each activity makes the grpc service call. Searched here, but did not come up with much. Any pointers much appreciated. Thanks.