nats-io / nats-jms-bridge

NATS to JMS Bridge for request/reply
12 stars 3 forks source link

During MQ to NATS flow, delivery time and expiration time is not getting copied correctly #270

Closed gstaware closed 3 years ago

gstaware commented 4 years ago

During MQ to NATS flow, looks like delivery time and expiration time is not getting copied as can be seen from below highlighted data.

JMSMessage class: jms_bytes JMSType: null JMSDeliveryMode: 1 JMSDeliveryDelay: 0 JMSDeliveryTime: 1600848727260 JMSExpiration: 0 JMSPriority: 9 JMSMessageID: ID:414d5120514d362020202020202020200dc5645fc6525624 JMSTimestamp: 1600848727259 JMSCorrelationID: d33008f4-dc0b-4ca6-8c9a-711a2a5ac523 JMSDestination: queue:///DEV.QUEUE.2 JMSReplyTo: queue:///DEV.QUEUE.1 JMSRedelivered: false JMSXAppID: MySimpleMqClientNoQModel JMSXDeliveryCount: 0 JMSXUserID: mqm JMS_IBM_PutApplType: 28 JMS_IBM_PutDate: 20200923 JMS_IBM_PutTime: 08161595 MyCustomHeaderSetAtMqClient: MyCustomHeaderValueSetAtMqClient 48656c6c6f20576f726c6421

Bridge message: BaseMessageWithHeaders{timestamp=1600848727259, expirationTime=-1, deliveryTime=-1, mode=1, type='NO_TYPE', redelivered=false, priority=9, headers={MyCustomHeaderSetAtMqClient=MyCustomHeaderValueSetAtMqClient, ENV=d33008f4-dc0b-4ca6-8c9a-711a2a5ac523}, bodyBytes=[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]}

gstaware commented 3 years ago

Closing as per below comment from Rick

Looks like you can’t set delivery time direct. It has to be set on the producer in JMS so the behavior is expected and we have unit tests to show that we are setting the properties. They are just not getting passed bc IBM MQ implementation. https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q119200_.htm

Same with expiration time.. the queue has to be configured to accept this

https://www.ibm.com/support/pages/how-specify-expiration-mq-message-and-when-expired-messages-are-removed-queue

This is not a bridge bug but an implementation detail of IBM MQ.