Commit Graph

59 Commits

Author SHA1 Message Date
Patrick Assuied 419f03fc02
Avro Schema registry kafka pubsub implementation (#3292)
Signed-off-by: Patrick Assuied <patrick.assuied@elationhealth.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2024-01-10 01:08:05 +00:00
Alessandro (Ale) Segala 934e86c4f7
Rename folder "internal" to "common" (#3225)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-11-14 11:36:38 -08:00
Alessandro (Ale) Segala ec05809ee6
[Metadata] Update validator and some other fixes (#2984)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-07-17 22:17:22 +00:00
Arturo Trenard ef4780beaa
Pubsub pluggable component bulkpublish (#2931)
Signed-off-by: arturo <jarturotrenard@gmail.com>
Signed-off-by: arturo <ajt@ptytechnologies.com>
Signed-off-by: Arturo Trenard <jarturotrenard@gmail.com>
Co-authored-by: arturo <ajt@ptytechnologies.com>
2023-06-22 15:14:18 +00:00
Bernd Verst 2b89d78a2d
Refactor Metadata Parsing of all PubSub Components (#2759)
Signed-off-by: Bernd Verst <github@bernd.dev>
2023-04-09 18:21:56 +00:00
Josh van Leeuwen 569c6be070
PubSub: Wait Group and context catching (#2500)
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <github@bernd.dev>
Co-authored-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-03-03 17:44:26 +00:00
Josh van Leeuwen d098e38d6a
Propagate context from caller to appropriate places in the code (#2474)
* 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>
2023-02-16 14:18:35 -08:00
Deepanshu Agarwal b2d8e6013b
Add bulkSubscribe request params to SubscribeRequest (#2405)
* Add bulkSubscribe configuration params

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Replace dapr/dapr package to run cert tests

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Change bulkSubscribe param types

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update latest dapr/dapr fork

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update correct dapr/dapr version

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* change BulkSubscribeRequest to Config

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update dapr/dapr version for cert

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update with latest dapr fork

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2023-01-10 09:30:25 -08:00
seachen e59dfd63c0 feature: add context to lock&pubsub API
Signed-off-by: seachen <seachen@tencent.com>
2022-12-14 19:37:24 +08:00
Deepanshu Agarwal f74b4d648d Update EntryID to EntryId
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-29 15:49:45 +05:30
deepanshuagarwal bcd101abad
Keys rename (#2135)
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-28 09:52:59 -07:00
Shubham Sharma 4f406a597f
Add bulk subscribe support to Azure Service Bus (#2100)
* Initial implementation

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* 

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add comment

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Refactor messages.go and add tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update message tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Refactor servicebus.go logic

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Refactor handleAsync

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Refactor ReceiveAndBlock

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update binding

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Review comments addressed

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Lint

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update metadata name

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update activeMessagesChan logic for concurrency control

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update metadata name

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Use request metadata instead of component metadata

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Review comments addressed

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix merge issue with metadata

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Remove unused metadata key

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix merge issue with metadata

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Lint!!!

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-09-23 10:49:06 -07:00
deepanshuagarwal 8500da577c
Conf test for Bulk Subscribe and Kafka fixes (#2113)
* Conf test for Bulk Sub and Kafka Fixes

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Fix linting

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Incorporating comments

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-23 09:54:21 -07:00
Mukundan Sundararajan a45f7db8b2 add bulkpublish-conf-test
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-09-21 11:46:46 +05:30
Bernd Verst e9e750bce6 fix linter issues
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-09-20 13:02:52 -07:00
Deepanshu Agarwal 217505fd16 Move common costants to common utils
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-16 22:22:54 +05:30
Deepanshu Agarwal d602e0ab0c Move constants to utils
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-16 22:07:38 +05:30
Deepanshu Agarwal 81898d5ee5 Config Per Topic and using maxAwaitDuration
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-16 20:04:32 +05:30
Deepanshu Agarwal d31f4d99f5 Merge branch 'feature/pubsub-batching' of github.com:dapr/components-contrib into ps_batch_c_kafka 2022-09-16 11:36:23 +05:30
Mukundan Sundararajan 3f9c42c4b8
Kafka bulk publish (#2059)
* Contrib updates for Batch Subscribe

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* commit

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Commit pubsub

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update structs

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update Default Batch struct name

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update Default Batch

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update return type for BatchPublish

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Add docs

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Rename batch to bulk

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* snssqs renam batch to bulk

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Renaming Bulker to BulkMessager

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Renaming names as discussed

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Minor updates

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Remove ContentType from BulkPublishRequest

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Update error type

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Changes to bulk subscribe and error type

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Segregating Bulk Publisher and Bulk Subscriber and removing them as mandatory

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Event Type name correction

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Docs update as per comments

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* bulk publish implementation for kafka

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* Add ctx to BulkPublish.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-09-15 13:17:17 -07:00
Deepanshu Agarwal f5542c70b9 Incorporate review comments and remove index based entryID
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-15 16:02:30 +05:30
Deepanshu Agarwal e483dfe334 Merge branch 'ps_batch_c' of github.com:DeepanshuA/components-contrib into ps_batch_c_kafka 2022-09-14 12:20:51 +05:30
Deepanshu Agarwal a1b1e3b871 Segregating Bulk Publisher and Bulk Subscriber and removing them as mandatory
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-14 10:55:48 +05:30
Deepanshu Agarwal 059461c6f4 Add kafka changes for bulk subscribe
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-13 01:01:05 +05:30
Deepanshu Agarwal 9988a62f4b Renaming Bulker to BulkMessager
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-07 12:47:24 +05:30
Deepanshu Agarwal 9a844a1bb0 Rename batch to bulk
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-07 12:00:08 +05:30
Deepanshu Agarwal 2e45f528be Update Default Batch struct name
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-09-05 13:48:18 +05:30
Deepanshu Agarwal 23fb488a9c Contrib updates for Batch Subscribe
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
2022-08-27 16:49:54 +05:30
Alessandro (Ale) Segala 704f4dd730
Add contexts to pubsub.Subscribe to allow early cancelation (#1756)
This commit is related to dapr/dapr#4624. As noted there, we have an issue in the runtime where all components are shut down after the grace period, when the app is likely already stopped. Because of that, certain input components (the subscribe part of pubsub and the input part of bindings - the latter not in scope of this PR), can continue bringing new work when it's known to fail.

In order to fix the issue linked above properly, we need to implement a way for PubSub components to have the "publish" part closed before the "subscribe" one (and in the future that will need to be done for input bindings too).

This commit achieves precisely that by adding a context in the Subscribe method. When that context is canceled (which can be at any time), the subscription is removed.

PS: This API change was implemented so it can one day be used for dapr/dapr#814 too, as it allows canceling individual subscriptions by using a different context. Although that's not possible today because it requires more work on the runtime, it does implement everything that's needed in the pubsub components already.
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-06-02 15:06:36 -07:00
Alessandro (Ale) Segala ca9fbf690e
Fixed Kafka PubSub to allow multiple handlers for different topics (#1755)
* Fixed Kafka PubSub to allow multiple handlers for different topics

With this, tests from #1743 are passing

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Removed read lock (for now)

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Updated as requested by @skyao

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Use interface type everywhere

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Fixed panic

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-06-01 15:31:11 -07:00
Sky Ao 8b5554dc71
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>
2022-05-10 20:07:23 -07:00
Phil Kedy 265fa9a9c2
Kafka PubSub: Use metadata as message headers. (#1409)
* Kafka PubSub: Setting metadata as message headers.

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>

* running go mod tidy on certification tests

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
2022-01-06 10:10:37 -08:00
Dmitry Shmulevich c7adb917f3
update license to Apache v2.0 (#1406) 2022-01-04 19:53:31 -08:00
Scott Hussey 897c2a4db5
Add OAuth2/OIDC support to Kafka pubsub (#1229)
* parent dbb18e4d77
author Scott Hussey <sthussey@gmail.com> 1632277042 -0500
committer Scott Hussey <sthussey@gmail.com> 1639111222 -0600

Support Oauth2 authentication for Kafka

- Utilize the SASL OAUTHBEARER mechanism to support
  the Oauth2 client_credentials flow for Kafka
  authentication

- Deprecate `authRequired` field and introduce `authType`
  to support varied authentication mechanisms

- Add a metadata upgrade mechanism to support backwards
  compatability

- Recommend broker specific scopes to guard against a
  compromised broker replaying a token

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* kafka test - use volumes instead of root

CI test fails due to losing data written to container
root

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* Clean up volumes

- When bringing down the docker-compose context, cleanup
  volumes

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* Clean up stale comment

Signed-off-by: Scott Hussey <sthussey@gmail.com>

* Resume config defaults

- Return some Kafka config to default values to lower config
  footprint and stabilize flaky CI runs

Signed-off-by: Scott Hussey <sthussey@gmail.com>
2021-12-28 10:34:28 -08:00
Sergey Krutsko 418fd96299 add kafkaVersion 2021-11-04 15:54:03 +03:00
Phil Kedy 1d0ce9ce23
Kafka certification: Adding more consumers and verifying messages are consumed (#1262)
* Adding second consumer and verifying messages are consumed

* Removed commented out code

* Adding async steps

* Added third consumer

* Adding consumer rebalance test

* Renaming watcher variables

* Update README.md

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-11-02 13:51:15 -07:00
Phil Kedy 9a3fe3f683
Kafka certification: Adding infra and network interruption tests (#1241)
* Adding infra and network interruption tests

* Tweak

* Using multierr.Combine

* Adding consumeRetryInterval setting to Kafka pubsub component
2021-10-27 17:41:27 -07:00
Taction c63fee5bec
Add tls support for kafka pubsub component (#1196)
* add tls support for kafka pubsub component

* fix review

* fix review

* delete unused json tag

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-10-25 15:40:53 -07:00
Long Dai 988fed05ab
ci: standard linter config (#1102)
* ci: standard linter config

Signed-off-by: Long <long.dai@intel.com>

* Update utils.go

* fix pulsar issue

Signed-off-by: Long <long.dai@intel.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-09-21 15:21:59 -07:00
Phil Kedy a0542ec922
Adding `initialOffset` option to Kafka binding and pubsub components (#1120)
* Adding `initialOffset` option to Kafka binding and pubsub components

* Only allow oldest and newest

* Fix tests

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-09-02 18:02:10 -07:00
Simon Leet f84a8b8914
Fix Kafka pubsub use of AuthRequired metadata (#1015)
Kafka pubsub component was not setting `k.authRequired` property based
on parsed `meta.AuthRequired` value, so would not correctly configure
Kafka producer or consumer with appropriate credentials when specified
by the author.

- Fix assignment of `meta.AuthRequired` to `k.authRequired` consumed by
  Subscribe().
- Fix initialization of `SyncProducer` to use copy of config with the
  authorization credentials added.

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-07-28 10:24:35 -07:00
iamazy 74af5b6528
rename ConsumerID to ConsumerGroup (#965)
* rename ConsumerID to ConsumerGroup

* rename consumerID to consumerGroup

* update the config in the conformance test

* set ConsumerID as alias of ConsumerGroup

* remove extra space

* gofmt

* add ClientID in kafka metadata

* remove ConsumerID field

* gofmt

* Update kafka.go

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-06-23 10:33:27 -07:00
Phil Kedy 8e6b36ecdf
Importing the retry and config packages from kit instead of internal (#940)
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-06-22 09:38:55 -07:00
iamazy a59dcc44eb
Fix typo (#927)
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-06-09 23:58:15 -07:00
Phil Kedy 1b30e75e60
Configurable retry (#854)
* no message

* Switching over usages of retry to the new package and making use of the DecodeConfig function

* Added decoding configuration using settings with a specific prefix

* Linter fixes

* Fixing linter error

* time.Sleep is the enemy

* Fix typo in comment

* Moving config to a pointer parameter so that the component can pass in the config with default values that make sense for that component.

* Renamed config struct

* Fix comment

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-05-06 09:43:57 -07:00
Phil Kedy 688df9bda4
Removed dependency on dapr/dapr in favor of dapr/kit. Fixed go mod dependencies afterwards. Go 1.16 in go.mod. Removed accidental log dependency. (#807) 2021-04-19 12:06:10 -07:00
Joni Collinge 36ed5ec84f use existing context for pubsub comps 2021-03-23 20:12:46 +00:00
Joni Collinge c054ae6ada Merge branch 'master' into jjcollinge/pubsub-context 2021-02-25 16:15:06 +00:00
Phil Kedy 4a0011bcbd
Improve conformance tests and add pulsar (#702)
* Improve conformance tests and add pulsar

* Fix linter error

* Fix linter errors

* Tweaks to pulsar pubsub per PR

* Switching uuid import

* Using Stringer interface to print message keys as base64 in logger

* Disabling some checks w/ Redis pubsub until the component can be enhanced

* Adding comment to eventually remove the simulateErrors option

* Add comment asBase64String to explain what it does

* Adding redelivery (reclaims) to the Redis pubsub component
Removed the temporary simulateErrors flag now that Redis is passing

* Fixing linter issues

* using a wait group instead of a sleep to wait for processing to complete

* More comments and refactoring

* comment tweaks

* Tweaks per PR

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-02-23 13:31:52 -08:00
Artur Souza dd3e463b52
Fix pubsub retry for Kafka (#688)
* Add conformance test for kafka pubsub + quickfix for Kafka error handling.

* Adding backoff/retry logic to the Kafka pub/sub component

* Add logic to return if error from backoff in kafka.

* Addressing PR comments and lint.

Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
2021-02-12 00:08:46 -08:00