Closed tyldum closed 6 years ago
I'll opt for following signature:
publish($body!, \%headers?, *@params)
which will allow to call it like this:
->publish($body, { header => 'value' }, routing_key => 'something',
mandatory => 1, immediate => 0);
->publish($body, routing_key => 'something');
->publish($body, { header => 'value' });
->publish($body);
With following rules:
What do you think?
I'm fine with that! Do you want a PR with that or would you prefer to do it yourself?
If you can, please write a PR - I don't have much spare time lately
@tyldum Just make it flexible.
In a5e148fc9c24a3612c6d37cf5d34dc1845200f62 I've changed publisher code to use ?routing_key=
query parameter instead of ?queue=
Resolved in 5a7cf91
AFAICS, the routing key is derived from the ?queue query-param. This means you need one publisher per routing key, while my design has a very dynamic routing key that is unlikely to repeat more than a few times per week.
I would like to introduce the routing key to publish(). I can create a PR, but I was debating with myself over semantics:
->publish('body',\%headers,'routing_key') vs ->publish('body', { headers => \%headers, routing_key => 'some.routing.key' }) The second one opens up for more flexibility for other options needed.