-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acb918e
commit 5befc85
Showing
8 changed files
with
79 additions
and
24 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
# Release procedure | ||
|
||
1. [ ] - generate clean go.mod: `make generate_gomod` | ||
2. [ ] - commit && push to master | ||
3. [ ] - update and validate examples: `make validate_examples` | ||
4. [ ] - update missing documentation | ||
5. [ ] - commit && push to master | ||
6. [ ] - add breaking changes to `UPGRADE-[new-version].md` | ||
7. [ ] - commit && push to master | ||
8. [ ] - wait for `master` CI build | ||
9. [ ] - [add release in GitHub](https://github.com/ThreeDotsLabs/watermill/releases) | ||
1. Generate clean go.mod: `make generate_gomod` | ||
2. Update and validate examples: `make validate_examples` | ||
3. Update missing documentation | ||
4. Check snippets in documentation (sometimes `first_line_contains` or `last_line_contains` can change position and load too much) | ||
5. Add breaking changes to `UPGRADE-[new-version].md` | ||
6. [Add release in GitHub](https://github.com/ThreeDotsLabs/watermill/releases) |
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 |
---|---|---|
@@ -1,23 +1,65 @@ | ||
# UPGRADE FROM 0.3.x to 0.4 | ||
|
||
# `watermill/components/cqrs` | ||
## `watermill/components/cqrs` | ||
|
||
### `CommandHandler.HandlerName` and `EventHandler.HandlerName` was added to the interface. | ||
|
||
If you are using metrics component, you may want to keep backward capability with handler names. In other case you can implement your own method of generating handler name. | ||
If you are using metrics component, you may want to keep backward capability with handler names. In other cases, you can implement your own method of generating handler name. | ||
|
||
Keeping backward capability for **event handlers**: | ||
|
||
``` | ||
func (h CommandHandler) HandlerName() string { | ||
return fmt.Sprintf("command_processor-%s", h) | ||
return fmt.Sprintf("command_processor-%s", h) | ||
} | ||
``` | ||
|
||
Keeping backward capability for **command handlers**: | ||
|
||
``` | ||
func (h EventHandler) HandlerName() string { | ||
return fmt.Sprintf("event_processor-%s", ObjectName(h)) | ||
return fmt.Sprintf("event_processor-%s", ObjectName(h)) | ||
} | ||
``` | ||
|
||
### Added `CommandsSubscriberConstructor` and `EventsSubscriberConstructor` | ||
|
||
From now on, `CommandsSubscriberConstructor` and `EventsSubscriberConstructor` are passed to constructors in CQRS component. | ||
|
||
They allow creating customized subscribers for every handler. For usage examples please check [_examples/cqrs-protobuf](_examples/cqrs-protobuf). | ||
|
||
|
||
### Added context to `CommandHandler.Handle`, `CommandBus.Send`, `EventHandler.Handle` and `EventBus.Send` | ||
|
||
Added missing context, which is passed to Publish function and handlers. | ||
|
||
### Other | ||
|
||
- `NewCommandProcessor` and `NewEventProcessor` now return an error instead of panic | ||
- `DuplicateCommandHandlerError` is returned instead of panic when two handlers are handling the same command | ||
- `CommandProcessor.routerHandlerFunc` and `EventProcessor.routerHandlerFunc` are now private | ||
- using `GenerateCommandsTopic` and `GenerateEventsTopic` functions instead of constant topic to allow more flexibility | ||
|
||
|
||
## `watermill/message/infrastructure/amqp` | ||
|
||
### `Config.QueueBindConfig.RoutingKey` was replaced with `GenerateRoutingKey` | ||
|
||
For backward compatibility, when using the constant value you should use a function: | ||
|
||
|
||
``` | ||
func(topic string) string { | ||
return "routing_key" | ||
} | ||
``` | ||
|
||
|
||
## `message/router/middleware` | ||
|
||
- `PoisonQueue` is now `PoisonQueue(pub message.Publisher, topic string) (message.HandlerMiddleware, error)`, not a struct | ||
|
||
|
||
## `message/router.go` | ||
|
||
- From now on, when all handlers are stopped, the router will also stop (`TestRouter_stop_when_all_handlers_stopped` test) |
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