Is there a way to change the Delivery Mode in Publ

2019-07-09 18:03发布

问题:

​I am sending messages to IBM MQ using Nifi PublishJMS processor. The Messages have Persistence = Persistent in MQ. I want to change it to Non-Persistent. Is there a property in Nifi PublishJms processor to correct this? Or is it done from the MQ side. I don't have access to MQ servers, I can only check the messages being delivered to the queue.

回答1:

At a low level a MQ client applications can specify the following persistence values:

  • MQPER_PERSISTENCE_AS_PARENT (Use the value of the next topic above this one)
  • MQPER_NOT_PERSISTENT (self-explanatory)
  • MQPER_PERSISTENT (self-explanatory)
  • MQPER_PERSISTENCE_AS_TOPIC_DEF (Use the value of this topic, the default on a topic is ASPARENT so this works like MQPER_PERSISTENCE_AS_PARENT where defaults are in use)

If nothing is specified then MQPER_PERSISTENCE_AS_TOPIC_DEF is the default.

Within the JMS API you can override this using a URI property as follows:

queue:///theQueueName?persistence=1


Property persistence and all URI properties are documented in the IBM MQ v8 Knowledge center page "Creating destinations in a JMS application".

Property name: persistence

  • -2 - As specified on the send() call or, if not specified on the send() call, the default persistence of the message producer.
  • -1 - As specified by the DefPersistence attribute of the IBM MQ queue or topic.
  • 1 - Nonpersistent.
  • 2 - Persistent.
  • 3 - Equivalent to the value HIGH for the PERSISTENCE property as used in the IBM MQ JMS administration tool. For an explanation of this value, see JMS persistent messages.