New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add timeToLive, priority, delay features to producer. #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
what's is the plan to handle cases with non fully compatible JMS/queue-interop brokers?
src/PsrProducer.php
Outdated
* | ||
* @param float|int $deliveryDelay - the delivery delay in milliseconds. | ||
*/ | ||
public function setDeliveryDelay($deliveryDelay); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it's a part of JMS, it may not be implementable for some brokers, e.g. RabbitMQ (in default setup) or may require specific broker settings (RabbitMQ will need https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/ plugin to support message dealayed delivery)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the transport does not support it will throw an exception.
JMS does not tell anything on what transport should do in this case (when it does not support a feature)
src/PsrProducer.php
Outdated
* | ||
* @param int $priority | ||
*/ | ||
public function setPriority($priority); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While in JMS spec 3.4.10 JMSPriority
it says
JMS does not require that a provider strictly implement priority ordering of
messages; however, it should do its best to deliver expedited messages ahead
of normal messages.
is there a list of implementation that potentially may support this feature?
src/PsrProducer.php
Outdated
* | ||
* @param int|float $timeToLive the message time to live to be used, in milliseconds; a value of zero means that a message never expires. | ||
*/ | ||
public function setTimeToLive($timeToLive); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JFYI: in RabbitMQ if message with ttl get to queue with ttl, the lower ttl of two will be chosen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap, there is nothing we can do with it.
https://docs.oracle.com/javaee/7/api/javax/jms/JMSProducer.html