-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Hello, this is a very great library! However, there is one small issue regarding the RabbitMQ transport.
Take rabbitmq-delayed-message-exchange plugin for the RabbitMQ server as an example.
Given an up and running RabbitMQ server with the rabbitmq-delayed-message-exchange plugin installed, the task is to simply use it and send a delayed message. For example, notify an external web server with a request after 1 hour, and if it succeeds, send an event down the bus, or else send another notification command down the bus that would be delayed for another 1 hour in case the external server is down or whatever.
This is currently impossible with node-ts/bus, because:
-
publishMessage builds its own headers from MessageAttributes and doesn't allow user-specified custom headers, so we can't use the
x-delayheader required for the delayed message. -
There is no possible way to create an exchange with a custom type, in our case
x-delayed-typeis needed. This is because all methods and fields to achieve this are privated out, so there is no intended way.
It would be much more helpful to be able to specify custom message headers and assert custom exchanges.