-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
7c35a4e
commit 704f4dd
Showing
37 changed files
with
948 additions
and
1,789 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '2' | ||
services: | ||
namesrv: | ||
image: apache/rocketmq:4.9.3 | ||
container_name: rmqnamesrv | ||
ports: | ||
- 9876:9876 | ||
#volumes: | ||
# - ./data/namesrv/logs:/home/rocketmq/logs | ||
command: sh mqnamesrv | ||
broker: | ||
image: apache/rocketmq:4.9.3 | ||
container_name: rmqbroker | ||
ports: | ||
- 10909:10909 | ||
- 10911:10911 | ||
- 10912:10912 | ||
#volumes: | ||
# - ./data/broker/logs:/home/rocketmq/logs | ||
# - ./data/broker/store:/home/rocketmq/store | ||
# - ./data/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.9.3/conf/broker.conf | ||
command: sh mqbroker -n namesrv:9876 -c ../conf/broker.conf | ||
depends_on: | ||
- namesrv | ||
console: | ||
image: styletang/rocketmq-console-ng:latest | ||
container_name: console | ||
links: | ||
- namesrv | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
JAVA_OPTS: "-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.