Changes the MongoDB state store to detect if it's connected to a replica set.
- When performing BulkSet or BulkDelete operations and connected to a replica set, uses a transaction to perform the operations more correctly (atomically) and faster
- When performing transactions, return an error if not connected to a replica set (the operation would fail, but this short-circuits the effort)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Propagates contexts to callers where appropriate.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Updates units tests with new func signature
Signed-off-by: joshvanl <me@joshvanl.dev>
* Fix linting errors
Signed-off-by: joshvanl <me@joshvanl.dev>
* Add atomic gate to alicloud rocketmq close channel.
Signed-off-by: joshvanl <me@joshvanl.dev>
* bindings/aws/kinesis use a separate ctx variable name
Signed-off-by: joshvanl <me@joshvanl.dev>
* binding/kafka: use atomic to prevent closing the channel twice
Signed-off-by: joshvanl <me@joshvanl.dev>
* bindings/mqtt3: use atomic bool to prevent close channel being closed multiple times
Signed-off-by: joshvanl <me@joshvanl.dev>
* bindings/mqtt3: use Background context for handle operations:w
Signed-off-by: joshvanl <me@joshvanl.dev>
* state/cocroachdb: add context to Ping()
Signed-off-by: joshvanl <me@joshvanl.dev>
* bindings/postgres: add comment explaining use of context.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Adds comment header to health/pinger.go
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/aws/snssqs: add waitgroup to wait for all go routines to finish
and block on Close(). Shuts down the subscription if there are no topic
handlers.
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/mqtt3: add atomic bool to prevent multiple channel closes. Add
wait group to block close on all goroutines to finish.
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/rabbitmq: fixes race conditions, uses atomic to prevent multiple
closes, add wait group to block close on all goroutines
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/redis: revert ctx passed when it could be cancelled. Add wait
group wait when closing.
Signed-off-by: joshvanl <me@joshvanl.dev>
* state/postges: pass context in init, and wait group on close.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Update all `Ping()` to `PingContext()` where possible.
Signed-off-by: joshvanl <me@joshvanl.dev>
* state/in-memory: add atomic bool to prevent closing channel multiple
times. Add wait group to block on close()
Signed-off-by: joshvanl <me@joshvanl.dev>
* state/mysql: don't use same ctx variable name
Signed-off-by: joshvanl <me@joshvanl.dev>
* Pass correct loop context to redis go routines
Signed-off-by: joshvanl <me@joshvanl.dev>
* Rename context when creating timeouts in state
Signed-off-by: joshvanl <me@joshvanl.dev>
* Remove state.Features() from requiring a context
Signed-off-by: joshvanl <me@joshvanl.dev>
* Revert wasm request handle Close func to be without context to
implement io.Closer interface. Add 5 second timeout. Add io.Closer
assertion in test.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Remove superfluous go lint vet directive
Signed-off-by: joshvanl <me@joshvanl.dev>
* Change Configuration Init function to take context
Signed-off-by: joshvanl <me@joshvanl.dev>
* Updates input binding interface to include a `Close() error` function. `Close`
blocks until all resources have been released and go routines have returned.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Change `Close() error` in input binding struct to `io.Closer` interface.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Update go.mod files to point to dapr/dapr PR https://github.com/dapr/dapr/pull/5831
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/redis: watch closeCh to shutdown worker instead of init context.
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/aws/snssqs + bindings/kubemq: ensure closeCh is caught so Close
correctly returns
Signed-off-by: joshvanl <me@joshvanl.dev>
* Close kubemq binding client on close. Ensure kafka consumer channel
cannot be closed more than once.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Tweaks
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Fixed cert tests
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* binding/mqtt3: add inline Background context instead of passing to
handleMessage
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/mqtt3: remove context from createSubscriberClientOptions
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/mqtt3: Remove `ResetConnection` func
Signed-off-by: joshvanl <me@joshvanl.dev>
* pubsub/kafka: Don't resubscribe if Subscribe is cancelled.
Signed-off-by: joshvanl <me@joshvanl.dev>
* binding/mqtt3: don't use context to control establishing connection
Signed-off-by: joshvanl <me@joshvanl.dev>
* bindings/mqtt3: Fix linting errors
Signed-off-by: joshvanl <me@joshvanl.dev>
---------
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
* Component metadata schema and tools
Includes tools to generate and validate components' schema, and a CI check to ensure the schema is always up-to-date.
Also, includes schemas for 4 components as a starter
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Changed version as requested
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* fix workflow
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Add base metadata for all components
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
* Fix lint issues on consul and mysql tests
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
* Pin candeia/dapr runtime version
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
* Add replace directive to use mcandeia/dapr on all go submodules
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
* Fixed runtime config instantiation
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
* Go 1.19 support and linter fixes
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Update workflows for Go1.19 and new linter version
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Remove unnecessary space in nolint directive
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* disable additional linters which aren't used because of Go generics
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* enable gosec linter again
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Update bindings/zeebe/command/publish_message_test.go
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Update bindings/output_binding.go
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Use prepared statement for mysql table creation
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Ping is not ping
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* c'mon linter
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Fix MySQL gosec issue
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* revert mysql to be fixed later
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Update readme of bindings (#1690)
Signed-off-by: pigletfly <wangbing.adam@gmail.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Fixing includedHeaders problem with spaces (#1610)
Signed-off-by: Ben Kotvis <kotvisbj@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Simplify vault token read (#1560)
* Simplify vault token get
Signed-off-by: zhangchao <zchao9100@gmail.com>
* fix lint
Signed-off-by: zhangchao <zchao9100@gmail.com>
* update tests
Signed-off-by: zhangchao <zchao9100@gmail.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: Eddie <eddie@wassef.com>
* GH-1609 : Fix for MongoDB Atlas conn strings
Added recommended fix in the issue
Signed-off-by: Eddie <eddie@wassef.com>
* updating the comment based on PR feedback
Signed-off-by: Eddie <eddie@wassef.com>
* Initial Certification test for eventhubs binding [incomplete] (#1670)
* certification test for eventhubs binding
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
* modified go.mod and go.sum
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
* Add connection string testing
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
* iothub testing
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
* address feedback and run test
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
* Install Azure CLI IOT hub extension
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* make modtidy-all
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* covering all eventhubs test cases
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
* dependency changes after go modtidy-all
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Use revive instead of golint (#1685)
Signed-off-by: pigletfly <wangbing.adam@gmail.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Updated to Go 1.18 (#1697)
* Updated to Go 1.18
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
* Added go.work file
With Go 1.18, this allows gopls (the Go language server used for example in VS Code) to work inside test apps too.
See: https://go.dev/doc/tutorial/workspaces
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Removed go.work
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Add metadata property to configure Batching in Pulsar (#1707)
* Add metadata property to configure BatchingMaxSize&batchingMaxMessages in Pulsar
Signed-off-by: saberwang <saberwang@hotmail.com>
* sort field
Signed-off-by: saberwang <saberwang@hotmail.com>
* [pubsub]fix unit test bug
Signed-off-by: saberwang <saberwang@hotmail.com>
* remove unrelated changes
Signed-off-by: saberwang <saberwang@hotmail.com>
* Delete hard coded Metadata
Signed-off-by: saberwang <saberwang@hotmail.com>
* remove .history
Signed-off-by: saberwang <saberwang@hotmail.com>
* restore .gitignore
Signed-off-by: saberwang <saberwang@hotmail.com>
* Hard coding default values and adding 'BatchingMaxPublishDelay' metadata
Signed-off-by: saberwang <saberwang@hotmail.com>
* fix code format
Signed-off-by: saberwang <saberwang@hotmail.com>
* formatting code
Signed-off-by: saberwang <saberwang@hotmail.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Fix 4529: Ignore Subscribe/Get wrong redis configuration type keys. (#1693)
* fix: 4529
Signed-off-by: LaurenceLiZhixin <382673304@qq.com>
* Fix: add test does not throw error for wrong type during get all test case of redis configuration
Signed-off-by: LaurenceLiZhixin <382673304@qq.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Ian Luo <ian.luo@gmail.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Signed-off-by: Eddie Wassef <eddie@wassef.com>
Fixing leading newline in linter error
Signed-off-by: Eddie <eddie@wassef.com>
* Implment a secret store based on Huawei CSMS (#1710)
Signed-off-by: Chen Cong <chock-cong.chen@outlook.com>
Co-authored-by: Chen Cong <chock-cong.chen@outlook.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Add yet another missing secret to eventhub binding cert test (#1713)
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Support custom queueEndpoint in Azure Storage Queues (#1692)
* Support custom queueEndpoint in Azure Storage Queues
Signed-off-by: Janusz Dziurzynski <janusz@corechain.tech>
* run gofmt
Signed-off-by: Janusz Dziurzynski <janusz@corechain.tech>
* Add "Url" to JSON field name for clarity
Suggested by @msfussell in dapr/docs#2424
Signed-off-by: Janusz Dziurzynski <janusz@corechain.tech>
Signed-off-by: Eddie <eddie@wassef.com>
* Refactory kafka binding to reuse the kafka common code extracting from kafka pubsub component (#1696)
* refactory kafka pubsub code to extract common kafka code for reuse
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* fix lint;add unit test for subscribeAdapter
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* move topics filed from internal kafak struct to pubsub kafka struct, since in input binding the topics will confiured in metadata
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* reuse internal kafka code for bindings
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* add redis standalone_test back which is delete by mistaken
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* small code improvement to trigger test
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* add license headers
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* try to set disbaleTls to true to verify the kafka connection fail
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* don't enable consum retry in kafka binding component;if authenticaion is disabled, need not set TLSDisable at the same time;
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
* fix lint
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Add topic metadata for mqtt input binding and support user defined topic for mqtt output binding (#1674)
* feat(bindings/mqtt): add data incoming topic to metadata
Signed-off-by: lotuc <lotu.c@outlook.com>
* feat(bindings/mqtt): support user defined topic on create action
Signed-off-by: lotuc <lotu.c@outlook.com>
* chore(bindings/mqtt): add integration test and topic response check test
Signed-off-by: lotuc <lotu.c@outlook.com>
* fix(bindings/mqtt): ignore misspell linting error for word mosquitto
Signed-off-by: lotuc <lotu.c@outlook.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: Eddie <eddie@wassef.com>
* Expire -> ExpiryInSeconds (#1721)
Signed-off-by: seeflood <349895584@qq.com>
Signed-off-by: Eddie <eddie@wassef.com>
* running gofmt -s -w state/mongodb/mongodb.go
Signed-off-by: Eddie <eddie@wassef.com>
* Update mongodb.go
Co-authored-by: Wang Bing <wangbing.adam@gmail.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Ben Kotvis <kotvisbj@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Taction <zchao9100@gmail.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: tanvigour <60332928+tanvigour@users.noreply.github.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: saber-wang <45062099+saber-wang@users.noreply.github.com>
Co-authored-by: Laurence <45508533+LaurenceLiZhixin@users.noreply.github.com>
Co-authored-by: Ian Luo <ian.luo@gmail.com>
Co-authored-by: Chock Chen <46557936+ChenCong0207@users.noreply.github.com>
Co-authored-by: Chen Cong <chock-cong.chen@outlook.com>
Co-authored-by: Janusz Dziurzynski <janusz@forserial.org>
Co-authored-by: Sky Ao <aoxiaojian@gmail.com>
Co-authored-by: lotuc <lotu.c@outlook.com>
Co-authored-by: seeflood <349895584@qq.com>