From c953f4393c8657cf28d7ebf8ab00eb116f90d795 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 2 Feb 2022 20:24:09 +0300 Subject: [PATCH 1/2] update temporal/sdk-go Signed-off-by: Valery Piashchynski --- activity/activity.go | 11 ++-- go.mod | 27 +++++----- go.sum | 64 ++++++++++++----------- internal/codec/proto/proto.go | 10 ++-- internal/data_converter/converter.go | 2 +- internal/data_converter/converter_test.go | 2 +- internal/interface.go | 2 +- internal/protocol.go | 9 ++-- internal/worker_info.go | 2 +- plugin.go | 8 +-- proto/api | 2 +- proto/protocol/v1/protocol.pb.go | 34 ++++++++---- proto/protocol/v1/protocol.proto | 3 ++ rpc.go | 4 +- tests/cancel_test.go | 7 ++- tests/child_test.go | 2 +- tests/configs/.rr-proto.yaml | 3 +- tests/disaster_test.go | 2 +- tests/env/docker-compose.yaml | 7 +-- tests/hp_test.go | 2 +- tests/metrics_test.go | 2 +- tests/query_test.go | 2 +- tests/server_test.go | 4 +- tests/signal_test.go | 2 +- workflow/handler.go | 19 ++++--- workflow/queue/queue.go | 7 +-- workflow/queue/queue_test.go | 2 +- workflow/registry/registry.go | 2 +- workflow/workflow.go | 12 +++-- 29 files changed, 141 insertions(+), 114 deletions(-) diff --git a/activity/activity.go b/activity/activity.go index aaf76cd9..461ad38e 100644 --- a/activity/activity.go +++ b/activity/activity.go @@ -10,14 +10,14 @@ import ( "github.com/google/uuid" "github.com/roadrunner-server/errors" "github.com/roadrunner-server/sdk/v2/utils" - tActivity "github.com/spiral/sdk-go/activity" - temporalClient "github.com/spiral/sdk-go/client" - "github.com/spiral/sdk-go/converter" - "github.com/spiral/sdk-go/internalbindings" - "github.com/spiral/sdk-go/worker" "github.com/temporalio/roadrunner-temporal/internal" "github.com/temporalio/roadrunner-temporal/internal/codec" commonpb "go.temporal.io/api/common/v1" + tActivity "go.temporal.io/sdk/activity" + temporalClient "go.temporal.io/sdk/client" + "go.temporal.io/sdk/converter" + "go.temporal.io/sdk/internalbindings" + "go.temporal.io/sdk/worker" "go.uber.org/zap" ) @@ -80,6 +80,7 @@ func (a *activity) Init() ([]worker.Worker, error) { ) } + wi[i].Options.DisableWorkflowWorker = true wrk := worker.New(a.client, wi[i].TaskQueue, wi[i].Options) for j := 0; j < len(wi[i].Activities); j++ { diff --git a/go.mod b/go.mod index f6db77fa..6741f059 100644 --- a/go.mod +++ b/go.mod @@ -12,18 +12,18 @@ require ( github.com/roadrunner-server/config/v2 v2.8.0-rc.3 github.com/roadrunner-server/endure v1.2.1 github.com/roadrunner-server/errors v1.1.1 - github.com/roadrunner-server/goridge/v3 v3.3.0 + github.com/roadrunner-server/goridge/v3 v3.3.1 github.com/roadrunner-server/informer/v2 v2.8.0-rc.1 - github.com/roadrunner-server/logger/v2 v2.8.0-rc.1 + github.com/roadrunner-server/logger/v2 v2.8.0-rc.2 github.com/roadrunner-server/resetter/v2 v2.8.0-rc.1 github.com/roadrunner-server/rpc/v2 v2.8.0-rc.1 - github.com/roadrunner-server/sdk/v2 v2.8.0-rc.1 + github.com/roadrunner-server/sdk/v2 v2.8.0-rc.2 github.com/roadrunner-server/server/v2 v2.8.0-rc.1 - github.com/spiral/sdk-go v1.12.0 - github.com/spiral/sdk-go/contrib/tally v0.0.0-20211210212330-614642034d01 github.com/stretchr/testify v1.7.0 github.com/uber-go/tally/v4 v4.1.1 go.temporal.io/api v1.7.0 + go.temporal.io/sdk v1.13.0 + go.temporal.io/sdk/contrib/tally v0.1.0 go.uber.org/zap v1.20.0 google.golang.org/protobuf v1.27.1 ) @@ -43,22 +43,19 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/hashicorp/go-version v1.4.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.12.0 + github.com/prometheus/client_golang v1.12.1 github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/roadrunner-server/tcplisten v1.1.0 // indirect + github.com/roadrunner-server/tcplisten v1.1.1 // indirect github.com/robfig/cron v1.2.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/spf13/afero v1.8.0 // indirect @@ -69,7 +66,7 @@ require ( github.com/stretchr/objx v0.3.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect - github.com/tklauser/numcpus v0.3.0 // indirect + github.com/tklauser/numcpus v0.4.0 // indirect github.com/twmb/murmur3 v1.1.6 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect @@ -77,13 +74,13 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/goleak v1.1.12 // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect + golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect - google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 // indirect - google.golang.org/grpc v1.43.0 // indirect + google.golang.org/genproto v0.0.0-20220201184016-50beb8ab5c44 // indirect + google.golang.org/grpc v1.44.0 // indirect gopkg.in/ini.v1 v1.66.3 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 950251e1..1af377dc 100644 --- a/go.sum +++ b/go.sum @@ -267,7 +267,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -313,18 +312,15 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= @@ -346,8 +342,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -375,23 +372,26 @@ github.com/roadrunner-server/endure v1.2.1/go.mod h1:36kWruojFlPhtsP/is8wVtWGYuG github.com/roadrunner-server/errors v1.1.0/go.mod h1:MzHjhRZIZc1ooMyYllUhNs0aTqRUbwcgUSO0TN7kCII= github.com/roadrunner-server/errors v1.1.1 h1:BzrB+xZE+iTISVfXSzIL9YbpPt6oHoRHgOBjlU/pigQ= github.com/roadrunner-server/errors v1.1.1/go.mod h1:MzHjhRZIZc1ooMyYllUhNs0aTqRUbwcgUSO0TN7kCII= -github.com/roadrunner-server/goridge/v3 v3.3.0 h1:Zrftjk2xNGzNnrma31ZrlPmwTJQIAa0Kmdeb58v+BQ4= github.com/roadrunner-server/goridge/v3 v3.3.0/go.mod h1:nOtQp0LEx2vxfnVT8/1PQIyK0BpFGhg8S0OCdlKdXbI= +github.com/roadrunner-server/goridge/v3 v3.3.1 h1:IYdm+smDfKl09AfFgKJeSNpSTp7KTgO3XfGPKrxs0vQ= +github.com/roadrunner-server/goridge/v3 v3.3.1/go.mod h1:f7SPSt9HUw5kbCc6Ofk4eEUU1xh2qHf/NznrTaW+aLA= github.com/roadrunner-server/informer/v2 v2.8.0-rc.1 h1:9wqD08IJf0iog262l4nmiACMHBRFeukkleDEL1q482s= github.com/roadrunner-server/informer/v2 v2.8.0-rc.1/go.mod h1:ec+8v1DrMM917eAbYBdP0TjggpWpwCv2eTco1K3v+uM= -github.com/roadrunner-server/logger/v2 v2.8.0-rc.1 h1:BbdGDEKz11z8QKO5ck12c0onsZ7Y2/ZYnPYhmYFyXxw= -github.com/roadrunner-server/logger/v2 v2.8.0-rc.1/go.mod h1:roSavcWv98Q7mlq+ycgfkv8H/nQZByZ90430ZKBv2b8= +github.com/roadrunner-server/logger/v2 v2.8.0-rc.2 h1:Ijt/MNCTg+rEEJ/S8jVrdFjcLgRojfs8cFFjjn/wPQE= +github.com/roadrunner-server/logger/v2 v2.8.0-rc.2/go.mod h1:roSavcWv98Q7mlq+ycgfkv8H/nQZByZ90430ZKBv2b8= github.com/roadrunner-server/resetter/v2 v2.8.0-rc.1 h1:RTkHJINd6cQWjUtldO4v7FfvWyP3osfwrqKuJOdXK60= github.com/roadrunner-server/resetter/v2 v2.8.0-rc.1/go.mod h1:m+qUh7T2bgrI4MtXHMG95RMQDNCQPAT4RPeBa73YzTs= github.com/roadrunner-server/rpc/v2 v2.8.0-rc.1 h1:kDrCf6VyHZWv0N2SWTJbNrV1e88RHOqS5cDQk1lFP0o= github.com/roadrunner-server/rpc/v2 v2.8.0-rc.1/go.mod h1:MSX6gfNaPtLjDQJXb/DOUQXhLpQnUiWhnzRsV9w1B8E= github.com/roadrunner-server/sdk/v2 v2.0.0-rc.1/go.mod h1:p3ENuBdCHQGgUn8Xji4N5tRb6e5NXX8yKbgtHY/caxQ= -github.com/roadrunner-server/sdk/v2 v2.8.0-rc.1 h1:JrpJOENqUWrfnFLOZT5Q3KlQTMbjXq/V8D2fGgL3w8s= github.com/roadrunner-server/sdk/v2 v2.8.0-rc.1/go.mod h1:qdd8LmqWQJj8+Sp0G51IVvuqx8yFBVfXilz+gVCWAPs= +github.com/roadrunner-server/sdk/v2 v2.8.0-rc.2 h1:6B/jOP8QDjgm/IfRfweIotousbSJz0hh0EmBEOFjs/o= +github.com/roadrunner-server/sdk/v2 v2.8.0-rc.2/go.mod h1:QcRv2Rz+oYg/dJ0qgJMsuovn0lwN7QjitHFCqC/1XiE= github.com/roadrunner-server/server/v2 v2.8.0-rc.1 h1:VG+K9uowPKGRYa5ZJ4CuUeFvC39G5xl2A/PFQjhOJk4= github.com/roadrunner-server/server/v2 v2.8.0-rc.1/go.mod h1:A2NBdk0GA3Q87X9EWT1Hm8y/fxeRDRf7wB4uAaCuuq0= -github.com/roadrunner-server/tcplisten v1.1.0 h1:DozwuIiND9seqz4infLvGTcSIJ5nDv9gF9H8UKNtXP8= github.com/roadrunner-server/tcplisten v1.1.0/go.mod h1:2MjzsggdgxCca4p2k3YJdWdo/QnQehiOTy0knlE226c= +github.com/roadrunner-server/tcplisten v1.1.1 h1:uVJVdg/zaasD2A4Mg+GyMlsUy2nLp9ADKec/REzql9Y= +github.com/roadrunner-server/tcplisten v1.1.1/go.mod h1:2MjzsggdgxCca4p2k3YJdWdo/QnQehiOTy0knlE226c= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -417,11 +417,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= -github.com/spiral/sdk-go v1.11.2/go.mod h1:iRDEyfVAr6PgFGaOv1+o5OVG9kmgTgspBwmO0GOY1p8= -github.com/spiral/sdk-go v1.12.0 h1:PSKXMVLwifyWhuveSdKlBJm5Grcs/0bRfp1XqXRO+QI= -github.com/spiral/sdk-go v1.12.0/go.mod h1:Y3IKVPm7/RAca9DDuTmFFo+f3Sj+QAm/MHo08Kb3oLY= -github.com/spiral/sdk-go/contrib/tally v0.0.0-20211210212330-614642034d01 h1:qQfQEQ3z6fG+FWxqyzUSiuUZpbWbze6hb5UthrT8i00= -github.com/spiral/sdk-go/contrib/tally v0.0.0-20211210212330-614642034d01/go.mod h1:fHu9AnyudU85kM53B1XeXb4RZq8G0OYgXc7g2rCMEbQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= @@ -437,8 +432,9 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= -github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= +github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg= @@ -466,13 +462,16 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= -go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= -go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.temporal.io/api v1.6.0/go.mod h1:YLj7h12DVi4m1ox3BgdGyD6OKO1yDn/cW4pO/SLrkcU= +go.temporal.io/api v1.5.0/go.mod h1:BqKxEJJYdxb5dqf0ODfzfMxh8UEQ5L3zKS51FiIYYkA= +go.temporal.io/api v1.6.1-0.20211110205628-60c98e9cbfe2/go.mod h1:IlUgOTGfmJuOkGrCZdptNxyXKE9CQz6oOx7/aH9bFY4= go.temporal.io/api v1.7.0 h1:fMaxrk8u12zPPOKgN6HCHyJjQQX6HcCxtMQTjck1rGE= go.temporal.io/api v1.7.0/go.mod h1:Bjxr81kDTMY0IYxbosWleAVOFE+Pnp4SRk87oWchYv8= +go.temporal.io/sdk v1.12.0/go.mod h1:lSp3lH1lI0TyOsus0arnO3FYvjVXBZGi/G7DjnAnm6o= +go.temporal.io/sdk v1.13.0 h1:8PW27o/uYAf1C1u8WUd6LNa6He2nYkBhdUX3c5gif5o= +go.temporal.io/sdk v1.13.0/go.mod h1:TCof7U/xas2FyDnx/UUEv4c/O/S41Lnhva+6JVer+Jo= +go.temporal.io/sdk/contrib/tally v0.1.0 h1:edAcGKNIDYU7fd10e4C/43dHw/h1F9cACupcmIKwzPI= +go.temporal.io/sdk/contrib/tally v0.1.0/go.mod h1:PckZI8gA0AxIBvrgT2FQlm8TaqptYmqRdy2NxOibsZQ= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -577,11 +576,11 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211101193420-4a448f8816b3/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211109214657-ef0fda0de508/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba h1:6u6sik+bn/y7vILcYkK3iwTBWN7WtBvB0+SZswQnbf8= -golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -680,15 +679,17 @@ golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211209171907-798191bca915/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -704,6 +705,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -867,12 +869,12 @@ google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211101144312-62acf1d99145/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= -google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220201184016-50beb8ab5c44 h1:0UVUC7VWA/mIU+5a4hVWH6xa234gLcRX8ZcrFKmWWKA= +google.golang.org/genproto v0.0.0-20220201184016-50beb8ab5c44/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -900,10 +902,10 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/internal/codec/proto/proto.go b/internal/codec/proto/proto.go index 4d749cd6..6bd38217 100644 --- a/internal/codec/proto/proto.go +++ b/internal/codec/proto/proto.go @@ -12,14 +12,14 @@ import ( "github.com/roadrunner-server/sdk/v2/payload" "github.com/roadrunner-server/sdk/v2/pool" "github.com/roadrunner-server/sdk/v2/utils" - temporalClient "github.com/spiral/sdk-go/client" - "github.com/spiral/sdk-go/converter" - "github.com/spiral/sdk-go/internalbindings" - "github.com/spiral/sdk-go/worker" - "github.com/spiral/sdk-go/workflow" "github.com/temporalio/roadrunner-temporal/internal" _codec "github.com/temporalio/roadrunner-temporal/internal/codec" protocolV1 "github.com/temporalio/roadrunner-temporal/proto/protocol/v1" + temporalClient "go.temporal.io/sdk/client" + "go.temporal.io/sdk/converter" + "go.temporal.io/sdk/internalbindings" + "go.temporal.io/sdk/worker" + "go.temporal.io/sdk/workflow" "go.uber.org/zap" "google.golang.org/protobuf/proto" ) diff --git a/internal/data_converter/converter.go b/internal/data_converter/converter.go index 30f5c29f..9b8a164a 100644 --- a/internal/data_converter/converter.go +++ b/internal/data_converter/converter.go @@ -1,8 +1,8 @@ package data_converter //nolint:revive,stylecheck import ( - "github.com/spiral/sdk-go/converter" commonpb "go.temporal.io/api/common/v1" + "go.temporal.io/sdk/converter" ) // DataConverter wraps Temporal data converter to enable direct access to the payloads. diff --git a/internal/data_converter/converter_test.go b/internal/data_converter/converter_test.go index 1405ff10..94168ba1 100644 --- a/internal/data_converter/converter_test.go +++ b/internal/data_converter/converter_test.go @@ -3,9 +3,9 @@ package data_converter //nolint:revive,stylecheck import ( "testing" - "github.com/spiral/sdk-go/converter" "github.com/stretchr/testify/assert" "go.temporal.io/api/common/v1" + "go.temporal.io/sdk/converter" ) func Test_Passthough(t *testing.T) { diff --git a/internal/interface.go b/internal/interface.go index 712c9a0b..4edc6c5a 100644 --- a/internal/interface.go +++ b/internal/interface.go @@ -3,7 +3,7 @@ package internal import ( "context" - "github.com/spiral/sdk-go/worker" + "go.temporal.io/sdk/worker" ) type Activity interface { diff --git a/internal/protocol.go b/internal/protocol.go index a58ee812..09455394 100644 --- a/internal/protocol.go +++ b/internal/protocol.go @@ -4,11 +4,11 @@ import ( "time" "github.com/roadrunner-server/errors" - "github.com/spiral/sdk-go/activity" - bindings "github.com/spiral/sdk-go/internalbindings" - "github.com/spiral/sdk-go/workflow" commonpb "go.temporal.io/api/common/v1" "go.temporal.io/api/failure/v1" + "go.temporal.io/sdk/activity" + bindings "go.temporal.io/sdk/internalbindings" + "go.temporal.io/sdk/workflow" ) const ( @@ -64,6 +64,9 @@ type Message struct { // Payloads contains message specific payloads in binary format. Payloads *commonpb.Payloads `json:"payloads,omitempty"` + + // Header + Header *commonpb.Header `json:"header,omitempty"` } // IsEmpty only check if task queue set. diff --git a/internal/worker_info.go b/internal/worker_info.go index 4dc7003a..a00848c7 100644 --- a/internal/worker_info.go +++ b/internal/worker_info.go @@ -1,7 +1,7 @@ package internal import ( - "github.com/spiral/sdk-go/worker" + "go.temporal.io/sdk/worker" ) // WorkerInfo outlines information about every available worker and it's TaskQueues. diff --git a/plugin.go b/plugin.go index d5de60f7..2a290294 100644 --- a/plugin.go +++ b/plugin.go @@ -12,10 +12,6 @@ import ( "github.com/roadrunner-server/errors" rrPool "github.com/roadrunner-server/sdk/v2/pool" "github.com/roadrunner-server/sdk/v2/state/process" - temporalClient "github.com/spiral/sdk-go/client" - "github.com/spiral/sdk-go/contrib/tally" - "github.com/spiral/sdk-go/converter" - "github.com/spiral/sdk-go/worker" "github.com/temporalio/roadrunner-temporal/activity" "github.com/temporalio/roadrunner-temporal/internal" "github.com/temporalio/roadrunner-temporal/internal/codec/proto" @@ -23,6 +19,10 @@ import ( "github.com/temporalio/roadrunner-temporal/internal/logger" "github.com/temporalio/roadrunner-temporal/workflow" "github.com/uber-go/tally/v4/prometheus" + temporalClient "go.temporal.io/sdk/client" + "go.temporal.io/sdk/contrib/tally" + "go.temporal.io/sdk/converter" + "go.temporal.io/sdk/worker" "go.uber.org/zap" ) diff --git a/proto/api b/proto/api index ed7d7427..78b36f93 160000 --- a/proto/api +++ b/proto/api @@ -1 +1 @@ -Subproject commit ed7d7427692cada52fc5915925ca2c7cde26d649 +Subproject commit 78b36f93afd89191b124781c38363f364f2f0238 diff --git a/proto/protocol/v1/protocol.pb.go b/proto/protocol/v1/protocol.pb.go index 7893f36b..ff941354 100644 --- a/proto/protocol/v1/protocol.pb.go +++ b/proto/protocol/v1/protocol.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 -// protoc v3.19.1 +// protoc v3.19.4 // source: protocol/v1/protocol.proto package protocolV1 @@ -84,6 +84,8 @@ type Message struct { Failure *v1.Failure `protobuf:"bytes,4,opt,name=failure,proto3" json:"failure,omitempty"` // invocation or result payloads. Payloads *v11.Payloads `protobuf:"bytes,5,opt,name=payloads,proto3" json:"payloads,omitempty"` + // invocation or result payloads. + Header *v11.Header `protobuf:"bytes,6,opt,name=header,proto3" json:"header,omitempty"` } func (x *Message) Reset() { @@ -153,6 +155,13 @@ func (x *Message) GetPayloads() *v11.Payloads { return nil } +func (x *Message) GetHeader() *v11.Header { + if x != nil { + return x.Header + } + return nil +} + var File_protocol_v1_protocol_proto protoreflect.FileDescriptor var file_protocol_v1_protocol_proto_rawDesc = []byte{ @@ -169,7 +178,7 @@ var file_protocol_v1_protocol_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x72, 0x6f, 0x61, 0x64, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x22, 0xc7, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x67, 0x65, 0x73, 0x22, 0xff, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, @@ -181,9 +190,12 @@ var file_protocol_v1_protocol_proto_rawDesc = []byte{ 0x3c, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x73, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x42, 0x0f, 0x5a, - 0x0d, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x64, 0x73, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x36, 0x0a, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -204,16 +216,18 @@ var file_protocol_v1_protocol_proto_goTypes = []interface{}{ (*Message)(nil), // 1: temporal.roadrunner.internal.Message (*v1.Failure)(nil), // 2: temporal.api.failure.v1.Failure (*v11.Payloads)(nil), // 3: temporal.api.common.v1.Payloads + (*v11.Header)(nil), // 4: temporal.api.common.v1.Header } var file_protocol_v1_protocol_proto_depIdxs = []int32{ 1, // 0: temporal.roadrunner.internal.Frame.messages:type_name -> temporal.roadrunner.internal.Message 2, // 1: temporal.roadrunner.internal.Message.failure:type_name -> temporal.api.failure.v1.Failure 3, // 2: temporal.roadrunner.internal.Message.payloads:type_name -> temporal.api.common.v1.Payloads - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 4, // 3: temporal.roadrunner.internal.Message.header:type_name -> temporal.api.common.v1.Header + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_protocol_v1_protocol_proto_init() } diff --git a/proto/protocol/v1/protocol.proto b/proto/protocol/v1/protocol.proto index 9d218eff..41d1fff5 100644 --- a/proto/protocol/v1/protocol.proto +++ b/proto/protocol/v1/protocol.proto @@ -25,4 +25,7 @@ message Message { // invocation or result payloads. temporal.api.common.v1.Payloads payloads = 5; + + // invocation or result payloads. + temporal.api.common.v1.Header header = 6; } \ No newline at end of file diff --git a/rpc.go b/rpc.go index 1d4d9c76..f041a8f3 100644 --- a/rpc.go +++ b/rpc.go @@ -2,9 +2,9 @@ package roadrunner_temporal //nolint:revive,stylecheck import ( v1Proto "github.com/golang/protobuf/proto" //nolint:staticcheck,nolintlint - "github.com/spiral/sdk-go/activity" - "github.com/spiral/sdk-go/client" commonpb "go.temporal.io/api/common/v1" + "go.temporal.io/sdk/activity" + "go.temporal.io/sdk/client" "google.golang.org/protobuf/proto" ) diff --git a/tests/cancel_test.go b/tests/cancel_test.go index 3ceb56f7..54969dee 100644 --- a/tests/cancel_test.go +++ b/tests/cancel_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/api/enums/v1" "go.temporal.io/api/history/v1" + "go.temporal.io/sdk/client" ) func Test_SimpleWorkflowCancelProto(t *testing.T) { @@ -116,7 +116,6 @@ func Test_CanceledWithCompensationWorkflowProto(t *testing.T) { ) assert.NoError(t, err) - time.Sleep(time.Second) err = s.Client().CancelWorkflow(context.Background(), w.GetID(), w.GetRunID()) assert.NoError(t, err) @@ -125,8 +124,8 @@ func Test_CanceledWithCompensationWorkflowProto(t *testing.T) { assert.Equal(t, "OK", result) e, err := s.Client().QueryWorkflow(context.Background(), w.GetID(), w.GetRunID(), "getStatus") - require.NotNil(t, e) require.NoError(t, err) + require.NotNil(t, e) trace := make([]string, 0) assert.NoError(t, e.Get(&trace)) @@ -221,7 +220,7 @@ func Test_CanceledNSingleScopeWorkflowProto(t *testing.T) { assert.Equal(t, "OK", result) e, err := s.Client().QueryWorkflow(context.Background(), w.GetID(), w.GetRunID(), "getStatus") - assert.NoError(t, err) + require.NoError(t, err) trace := make([]string, 0) assert.NoError(t, e.Get(&trace)) diff --git a/tests/child_test.go b/tests/child_test.go index 6942ff4a..433e0206 100644 --- a/tests/child_test.go +++ b/tests/child_test.go @@ -5,8 +5,8 @@ import ( "sync" "testing" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" + "go.temporal.io/sdk/client" ) func Test_ExecuteChildWorkflowProto(t *testing.T) { diff --git a/tests/configs/.rr-proto.yaml b/tests/configs/.rr-proto.yaml index f9cf46b0..17645606 100644 --- a/tests/configs/.rr-proto.yaml +++ b/tests/configs/.rr-proto.yaml @@ -6,9 +6,10 @@ server: temporal: address: "localhost:7233" + cache_size: 100000 activities: num_workers: 4 logs: mode: development - level: warn \ No newline at end of file + level: error \ No newline at end of file diff --git a/tests/disaster_test.go b/tests/disaster_test.go index 95229b2c..5909dae2 100644 --- a/tests/disaster_test.go +++ b/tests/disaster_test.go @@ -11,9 +11,9 @@ import ( goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" "github.com/roadrunner-server/sdk/v2/state/process" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.temporal.io/sdk/client" ) func Test_WorkerError_DisasterRecovery(t *testing.T) { diff --git a/tests/env/docker-compose.yaml b/tests/env/docker-compose.yaml index 74671114..688b9676 100644 --- a/tests/env/docker-compose.yaml +++ b/tests/env/docker-compose.yaml @@ -3,7 +3,7 @@ version: '3.7' services: postgresql: container_name: temporal-postgresql - image: postgres:14.1 + image: postgres:14 environment: POSTGRES_PASSWORD: temporal POSTGRES_USER: temporal @@ -12,7 +12,7 @@ services: temporal: container_name: temporal - image: temporalio/auto-setup:1.13.1 + image: temporalio/auto-setup:1.14.2 depends_on: - postgresql environment: @@ -21,12 +21,13 @@ services: - POSTGRES_USER=temporal - POSTGRES_PWD=temporal - POSTGRES_SEEDS=postgresql + - DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml ports: - "7233:7233" temporal-admin-tools: container_name: temporal-admin-tools - image: temporalio/admin-tools:1.13.1 + image: temporalio/admin-tools:1.14.2 depends_on: - temporal environment: diff --git a/tests/hp_test.go b/tests/hp_test.go index 33c69bb2..dbb17125 100644 --- a/tests/hp_test.go +++ b/tests/hp_test.go @@ -16,10 +16,10 @@ import ( "go.temporal.io/api/common/v1" "github.com/fatih/color" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" "go.temporal.io/api/enums/v1" "go.temporal.io/api/history/v1" + "go.temporal.io/sdk/client" ) func init() { //nolint:gochecknoinits diff --git a/tests/metrics_test.go b/tests/metrics_test.go index a9ddc95e..edec323e 100644 --- a/tests/metrics_test.go +++ b/tests/metrics_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" + "go.temporal.io/sdk/client" ) func Test_SimpleWorkflowCancelMetrics(t *testing.T) { diff --git a/tests/query_test.go b/tests/query_test.go index a66fdca6..86bf7af8 100644 --- a/tests/query_test.go +++ b/tests/query_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" + "go.temporal.io/sdk/client" ) func Test_ListQueriesProto(t *testing.T) { diff --git a/tests/server_test.go b/tests/server_test.go index bd44375e..8a64843a 100644 --- a/tests/server_test.go +++ b/tests/server_test.go @@ -15,14 +15,14 @@ import ( "github.com/roadrunner-server/resetter/v2" "github.com/roadrunner-server/rpc/v2" "github.com/roadrunner-server/server/v2" - temporalClient "github.com/spiral/sdk-go/client" - "github.com/spiral/sdk-go/converter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" roadrunnerTemporal "github.com/temporalio/roadrunner-temporal" "github.com/temporalio/roadrunner-temporal/internal/data_converter" "go.temporal.io/api/enums/v1" "go.temporal.io/api/history/v1" + temporalClient "go.temporal.io/sdk/client" + "go.temporal.io/sdk/converter" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) diff --git a/tests/signal_test.go b/tests/signal_test.go index e20a0523..22b4a009 100644 --- a/tests/signal_test.go +++ b/tests/signal_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/pborman/uuid" - "github.com/spiral/sdk-go/client" "github.com/stretchr/testify/assert" "go.temporal.io/api/enums/v1" "go.temporal.io/api/history/v1" + "go.temporal.io/sdk/client" ) func Test_SignalsWithoutSignalsProto(t *testing.T) { diff --git a/workflow/handler.go b/workflow/handler.go index cff03abe..bad01484 100644 --- a/workflow/handler.go +++ b/workflow/handler.go @@ -6,10 +6,10 @@ import ( "time" "github.com/roadrunner-server/errors" - bindings "github.com/spiral/sdk-go/internalbindings" - "github.com/spiral/sdk-go/workflow" "github.com/temporalio/roadrunner-temporal/internal" commonpb "go.temporal.io/api/common/v1" + bindings "go.temporal.io/sdk/internalbindings" + "go.temporal.io/sdk/workflow" ) const completed string = "completed" @@ -28,29 +28,31 @@ func (wp *process) handleCancel() { _ = wp.mq.PushCommand( internal.CancelWorkflow{RunID: wp.env.WorkflowInfo().WorkflowExecution.RunID}, nil, + wp.header, ) } // schedule the signal processing -func (wp *process) handleSignal(name string, input *commonpb.Payloads) error { +func (wp *process) handleSignal(name string, input *commonpb.Payloads, header *commonpb.Header) error { _ = wp.mq.PushCommand( internal.InvokeSignal{ RunID: wp.env.WorkflowInfo().WorkflowExecution.RunID, Name: name, }, input, + header, ) return nil } // Handle query in blocking mode. -func (wp *process) handleQuery(queryType string, queryArgs *commonpb.Payloads) (*commonpb.Payloads, error) { +func (wp *process) handleQuery(queryType string, queryArgs *commonpb.Payloads, header *commonpb.Header) (*commonpb.Payloads, error) { const op = errors.Op("workflow_process_handle_query") result, err := wp.runCommand(internal.InvokeQuery{ RunID: wp.runID, Name: queryType, - }, queryArgs) + }, queryArgs, header) if err != nil { return nil, errors.E(op, err) @@ -165,7 +167,7 @@ func (wp *process) handleMessage(msg *internal.Message) error { wp.env.Complete(nil, &workflow.ContinueAsNewError{ WorkflowType: &bindings.WorkflowType{Name: command.Name}, Input: msg.Payloads, - Header: wp.header, + Header: msg.Header, TaskQueueName: command.Options.TaskQueueName, WorkflowExecutionTimeout: command.Options.WorkflowExecutionTimeout, WorkflowRunTimeout: command.Options.WorkflowRunTimeout, @@ -180,6 +182,7 @@ func (wp *process) handleMessage(msg *internal.Message) error { command.Signal, msg.Payloads, nil, + msg.Header, command.ChildWorkflowOnly, wp.createCallback(msg.ID), ) @@ -281,9 +284,9 @@ func (wp *process) flushQueue() error { } // Run single command and return single result. -func (wp *process) runCommand(cmd interface{}, payloads *commonpb.Payloads) (*internal.Message, error) { +func (wp *process) runCommand(cmd interface{}, payloads *commonpb.Payloads, header *commonpb.Header) (*internal.Message, error) { const op = errors.Op("workflow_process_runcommand") - _, msg := wp.mq.AllocateMessage(cmd, payloads) + _, msg := wp.mq.AllocateMessage(cmd, payloads, header) result, err := wp.codec.Execute(wp.getContext(), &msg) if err != nil { diff --git a/workflow/queue/queue.go b/workflow/queue/queue.go index 06e5519f..075c2d74 100644 --- a/workflow/queue/queue.go +++ b/workflow/queue/queue.go @@ -22,18 +22,19 @@ func (mq *MessageQueue) Flush() { mq.Queue = mq.Queue[0:0] } -func (mq *MessageQueue) AllocateMessage(cmd interface{}, payloads *common.Payloads) (uint64, internal.Message) { +func (mq *MessageQueue) AllocateMessage(cmd interface{}, payloads *common.Payloads, header *common.Header) (uint64, internal.Message) { msg := internal.Message{ ID: mq.SeqID(), Command: cmd, Payloads: payloads, + Header: header, } return msg.ID, msg } -func (mq *MessageQueue) PushCommand(cmd interface{}, payloads *common.Payloads) uint64 { - id, msg := mq.AllocateMessage(cmd, payloads) +func (mq *MessageQueue) PushCommand(cmd interface{}, payloads *common.Payloads, header *common.Header) uint64 { + id, msg := mq.AllocateMessage(cmd, payloads, header) mq.Queue = append(mq.Queue, &msg) return id } diff --git a/workflow/queue/queue_test.go b/workflow/queue/queue_test.go index 1b564042..ca6da8d0 100644 --- a/workflow/queue/queue_test.go +++ b/workflow/queue/queue_test.go @@ -44,7 +44,7 @@ func Test_MessageQueueCommandID(t *testing.T) { return atomic.AddUint64(&index, 1) }) - n := mq.PushCommand(internal.StartWorkflow{}, &common.Payloads{}) + n := mq.PushCommand(internal.StartWorkflow{}, &common.Payloads{}, &common.Header{}) assert.Equal(t, n, index) assert.Len(t, mq.Queue, 1) diff --git a/workflow/registry/registry.go b/workflow/registry/registry.go index 352b6b15..294fb8d0 100644 --- a/workflow/registry/registry.go +++ b/workflow/registry/registry.go @@ -3,7 +3,7 @@ package registry import ( "sync" - bindings "github.com/spiral/sdk-go/internalbindings" + bindings "go.temporal.io/sdk/internalbindings" ) // IDRegistry used to gain access to child workflow ids after they become available via callback result. diff --git a/workflow/workflow.go b/workflow/workflow.go index ee10c0a7..dae0c3eb 100644 --- a/workflow/workflow.go +++ b/workflow/workflow.go @@ -7,16 +7,16 @@ import ( "github.com/google/uuid" "github.com/roadrunner-server/errors" - temporalClient "github.com/spiral/sdk-go/client" - bindings "github.com/spiral/sdk-go/internalbindings" - "github.com/spiral/sdk-go/worker" - "github.com/spiral/sdk-go/workflow" "github.com/temporalio/roadrunner-temporal/internal" "github.com/temporalio/roadrunner-temporal/internal/codec" "github.com/temporalio/roadrunner-temporal/workflow/canceller" "github.com/temporalio/roadrunner-temporal/workflow/queue" "github.com/temporalio/roadrunner-temporal/workflow/registry" commonpb "go.temporal.io/api/common/v1" + temporalClient "go.temporal.io/sdk/client" + bindings "go.temporal.io/sdk/internalbindings" + "go.temporal.io/sdk/worker" + "go.temporal.io/sdk/workflow" "go.uber.org/zap" ) @@ -113,6 +113,7 @@ func (wp *process) Execute(env bindings.WorkflowEnvironment, header *commonpb.He LastCompletion: lastCompletionOffset, }, input, + wp.header, ) } @@ -165,6 +166,7 @@ func (wp *process) StackTrace() string { RunID: wp.env.WorkflowInfo().WorkflowExecution.RunID, }, nil, + wp.header, ) if err != nil { @@ -186,7 +188,7 @@ func (wp *process) StackTrace() string { func (wp *process) Close() { // send destroy command - _, _ = wp.runCommand(internal.DestroyWorkflow{RunID: wp.env.WorkflowInfo().WorkflowExecution.RunID}, nil) + _, _ = wp.runCommand(internal.DestroyWorkflow{RunID: wp.env.WorkflowInfo().WorkflowExecution.RunID}, nil, wp.header) // flush queue wp.mq.Flush() } From 00d634a975e61cdf1e5bc355ef9b1caa6af03d16 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 2 Feb 2022 20:30:12 +0300 Subject: [PATCH 2/2] Use logger.Plugin instead of logger.ZapLogger Signed-off-by: Valery Piashchynski --- tests/server_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/server_test.go b/tests/server_test.go index 8a64843a..0ea53856 100644 --- a/tests/server_test.go +++ b/tests/server_test.go @@ -86,7 +86,7 @@ func NewTestServerWithMetrics(t *testing.T, stopCh chan struct{}, wg *sync.WaitG err = container.RegisterAll( &roadrunnerTemporal.Plugin{}, initConfigProtoWithMetrics(), - &logger.ZapLogger{}, + &logger.Plugin{}, &resetter.Plugin{}, &informer.Plugin{}, &server.Plugin{}, @@ -143,7 +143,7 @@ func NewTestServer(t *testing.T, stopCh chan struct{}, wg *sync.WaitGroup) *Test err = container.RegisterAll( cfg, &roadrunnerTemporal.Plugin{}, - &logger.ZapLogger{}, + &logger.Plugin{}, &resetter.Plugin{}, &informer.Plugin{}, &server.Plugin{},