We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
'== APP - job-service == Starting droid: R2-D2' '== APP - job-service == Executing maintenance job: Oil Change' '== APP - job-service == Starting droid: C-3PO' '== APP - job-service == Executing maintenance job: Memory Wipe'
== APP - job-service == Job scheduled: R2-D2 == APP - job-service == Job scheduled: C-3PO == APP - job-service == 2024/10/06 15:43:19 job:{name:"C-3PO" due_time:"15s" data:{value:"{\"droid\":\"C-3PO\",\"Task\":\"Memory Wipe\"}"}} == APP - job-scheduler == Get job response: {"droid":"C-3PO","Task":"Memory Wipe"} == APP - job-service == Job scheduled: BB-8 == APP - job-service == 2024/10/06 15:43:19 job:{name:"BB-8" due_time:"30s" data:{value:"{\"droid\":\"BB-8\",\"Task\":\"Internal Gyroscope Check\"}"}} == APP - job-scheduler == Get job response: {"droid":"BB-8","Task":"Internal Gyroscope Check"} == APP - job-scheduler == Job deleted: BB-8 Exited App successfully ERRO[0021] unexpected status code returned from app while processing triggered job R2-D2. status code returned: 2 app_id=job-service instance=Nordrassil.local scope=dapr.runtime.scheduler type=log ver=1.14.4 ERRO[0031] unexpected status code returned from app while processing triggered job C-3PO. status code returned: 2 app_id=job-service instance=Nordrassil.local scope=dapr.runtime.scheduler type=log ver=1.14.4
Run the existing example with:
[quickstarts] dapr build-info CLI: Version: 1.14.1 Git Commit: Git Version: Runtime: Version: 1.14.4 Git Commit: 583960dc90120616124b60ad2b7820fc0b3edf44 Git Version: 583960d
It would appear that API has changed and now the common.JobEvent contains the actual Job payload as opposed to expected common.Job (job spec).
common.JobEvent
common.Job
Fix jobs/go/sdk/job-service/job-service.go:
jobs/go/sdk/job-service/job-service.go
// Handler that handles job events func handleJob(ctx context.Context, job *common.JobEvent) error { var jobPayload JobData if err := json.Unmarshal(job.Data, &jobPayload); err != nil { return fmt.Errorf("failed to unmarshal payload: %v", err) } fmt.Println("Starting droid:", jobPayload.Droid) fmt.Println("Executing maintenance job:", jobPayload.Task) return nil }
After the fix we see the expected output:
== APP - job-service == Job scheduled: R2-D2 == APP - job-service == Job scheduled: C-3PO == APP - job-service == 2024/10/06 15:51:38 job:{name:"C-3PO" due_time:"15s" data:{value:"{\"droid\":\"C-3PO\",\"Task\":\"Memory Wipe\"}"}} == APP - job-scheduler == Get job response: {"droid":"C-3PO","Task":"Memory Wipe"} == APP - job-service == Job scheduled: BB-8 == APP - job-service == 2024/10/06 15:51:38 job:{name:"BB-8" due_time:"30s" data:{value:"{\"droid\":\"BB-8\",\"Task\":\"Internal Gyroscope Check\"}"}} == APP - job-scheduler == Get job response: {"droid":"BB-8","Task":"Internal Gyroscope Check"} == APP - job-scheduler == Job deleted: BB-8 Exited App successfully == APP - job-service == Starting droid: R2-D2 == APP - job-service == Executing maintenance job: Oil Change == APP - job-service == Starting droid: C-3PO == APP - job-service == Executing maintenance job: Memory Wipe
The text was updated successfully, but these errors were encountered:
Closing, fixed by @cicoyle in #1097
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Expected Behavior
Actual Behavior
Steps to Reproduce the Problem
Run the existing example with:
Analysis
It would appear that API has changed and now the
common.JobEvent
contains the actual Job payload as opposed to expectedcommon.Job
(job spec).Fix
jobs/go/sdk/job-service/job-service.go
:After the fix we see the expected output:
The text was updated successfully, but these errors were encountered: