Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error invoking rpc in golang sdk #477

Open
dennissetiawan opened this issue Nov 8, 2024 · 3 comments
Open

Error invoking rpc in golang sdk #477

dennissetiawan opened this issue Nov 8, 2024 · 3 comments

Comments

@dennissetiawan
Copy link

dennissetiawan commented Nov 8, 2024

Hi i'm trying to invoke RPC in a state via unregistered client in go sdk

//RPC Definition
func (w MyWorkflow) Notification(ctx iwf.WorkflowContext, input iwf.Object, persistence iwf.Persistence, communication iwf.Communication) (interface{}, error) {

	......
}


type initState struct {
	iwf.WorkflowStateDefaultsNoWaitUntil
	iwfClient iwf.UnregisteredClient
}

func (ths initState) Execute(ctx iwf.WorkflowContext, input iwf.Object, commandResults iwf.CommandResults, persistence iwf.Persistence, communication iwf.Communication) (*iwf.StateDecision, error) {
	....
	ths.iwfClient.InvokeRPCByName(ctx, GetWorkflowID(inp.ID), "", "Notification", inp.ID, nil, nil).
	....
}

But it returns 420 error in the iwf server.

In iwf server there is this log
2024-11-07 22:27:38 [GIN] 2024/11/07 - 15:27:38 | 420 | 19.007541ms | 172.18.0.1 | POST "/api/v1/workflow/rpc"

Did i get the rpc name and function call correctly?

@longquanzheng
Copy link
Contributor

420 means that the invoking is successful but the worker(your application) got some error when execute it. Do you see some error there?

@longquanzheng
Copy link
Contributor

Are you able to invoke rpc using Client(not unregistered) successfully? Just to make sure that RPC is registered and implemented correctly

@longquanzheng
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants