[ 
https://issues.apache.org/jira/browse/ARTEMIS-1049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15948304#comment-15948304
 ] 

Justin Bertram commented on ARTEMIS-1049:
-----------------------------------------

Your use-case isn't valid as far as I can tell.  According to the JMS spec the 
method {{setJMSDeliveryTime()}} is not valid to be used by clients.  See the 
[relevant 
JavaDoc|https://docs.oracle.com/javaee/7/api/javax/jms/Message.html#setJMSDeliveryTime-long-],
 "This method is for use by JMS providers only to set this field when a message 
is sent. This message cannot be used by clients to configure the delivery time 
of the message. This method is public to allow a JMS provider to set this field 
when sending a message whose implementation is not its own."

I believe you probably want to use 
javax.jms.MessageProducer.setDeliveryDelay(long) to control the time of message 
delivery.

In any case, let me know if you see the same issue once you've updated your 
client code to follow the JMS specification.

> JMSDeliveryTime silently break JMSXGroupID
> ------------------------------------------
>
>                 Key: ARTEMIS-1049
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1049
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Igor Vagulin
>
> Due to some issue in code my message get both delivery time and JMSXGroupID 
> property set. This breaks ordering guaranteed by JMSXGroupID, one consumer 
> working thought. 
> Please at least add some warning to log. Spent 2 days of my life trying to 
> hunt this down.
> message produced by code below will not be properly ordered
> {quote}
> conn = connFactory.createConnection();
> session = conn.createSession();
> MapMessage m1 = session.createMapMessage();
> MapMessage m2 = session.createMapMessage();
> producer = session.createProducer(null);
> long deliveryTime = ZonedDateTime.now().toEpochSecond() * 1000
> m1.setJMSDeliveryTime(deliveryTime);
> m1.setStringProperty("JMSXGroupID", "mylovelygroup");
> m2.setJMSDeliveryTime(deliveryTime);
> m3.setStringProperty("JMSXGroupID", "mylovelygroup");
> producer.send(d, m1);
> producer.send(d, m2);
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to