Version x.3.x
This release continues the move toward a message-driven API for working with the bus. The goal is to keep the public surface cleaner and make bus-related actions more explicit and consistent.
What changed
Message locking and unlocking
You can now lock and unlock message types using dedicated messages:
LockMessageUnlockMessage
A locked message type can still be registered, but it will not be published until it is unlocked again.
Disconnecting messages from processing
DisconnectMessage was introduced to completely remove a message from processing.
It accepts a message ID and will:
close all subscriptions for that message;
prevent it from being published through the bus;
prevent new subscriptions from being created.
Middleware management through messages
Middleware management now also follows the message-based model:
AddMiddlewareRemoveMiddleware
This replaces direct calls to addMiddleware() and removeMiddleware() on PostboyService.
Unified message connection
ConnectMessage replaces the old split between:
record()recordWithPipe()
Now both cases are handled by the same mechanism:
if no pipe is needed, connect the subject directly;
if a pipe is needed, pass it as part of
ConnectMessage.
Public API
The following new executors are now exported as part of the public API:
AddMiddlewareRemoveMiddlewareLockMessageUnlockMessageDisconnectMessageConnectMessageConnectExecutorConnectHandlerAddNamespaceEliminateNamespace
Migration notes
Replace direct PostboyService calls with message execution:
A few practical rules:
use
ConnectMessageinstead ofrecord()andrecordWithPipe();use
DisconnectMessageinstead ofunregister();use
AddMiddleware/RemoveMiddlewareinstead ofaddMiddleware()/removeMiddleware();use
AddNamespace/EliminateNamespaceinstead ofregisterNamespace()/unregisterNamespace()use
ConnectExecutorinstead ofrecordExecutor();use
ConnectHandlerinstead of `recordHandler();
Why this change
The idea is to move infrastructure and lifecycle operations into the same event-driven model as message publication itself. That keeps the API more consistent, makes the bus behavior easier to reason about, and reduces direct coupling to PostboyService internals.