UPGRADE-0.4.md
watermill/components/cqrsCommandHandler.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 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)
}
Keeping backward capability for command handlers:
func (h EventHandler) HandlerName() string {
return fmt.Sprintf("event_processor-%s", ObjectName(h))
}
CommandsSubscriberConstructor and EventsSubscriberConstructorFrom 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.
CommandHandler.Handle, CommandBus.Send, EventHandler.Handle and EventBus.SendAdded missing context, which is passed to Publish function and handlers.
NewCommandProcessor and NewEventProcessor now return an error instead of panicDuplicateCommandHandlerError is returned instead of panic when two handlers are handling the same commandCommandProcessor.routerHandlerFunc and EventProcessor.routerHandlerFunc are now privateGenerateCommandsTopic and GenerateEventsTopic functions instead of constant topic to allow more flexibilitywatermill/message/infrastructure/amqpConfig.QueueBindConfig.RoutingKey was replaced with GenerateRoutingKeyFor backward compatibility, when using the constant value you should use a function:
func(topic string) string {
return "routing_key"
}
message/router/middlewarePoisonQueue is now PoisonQueue(pub message.Publisher, topic string) (message.HandlerMiddleware, error), not a structmessage/router.goTestRouter_stop_when_all_handlers_stopped test)