Topic
  • 4 replies
  • Latest Post - ‏2017-01-02T14:25:35Z by fjb_saper
Dcompany
Dcompany
2 Posts

Pinned topic IBM MQ peristance property for non-persistent messages

‏2016-12-01T11:42:12Z | mq persistance

Hi,

A queue is created as a persistent , which has both persistent and non-persistent messages. If there is a QM restart/fail-over , can messages be lost ?. thanks..

 

 

 

  • ValerieLampkin
    ValerieLampkin
    3 Posts

    Re: IBM MQ peristance property for non-persistent messages

    ‏2016-12-01T21:58:12Z  

    Yes, the definition of the queue only comes into play if the putting application chooses to use the default settings of the queue.  Otherwise, if the messages are put as non-persistent, those messages will be deleted upon qmgr restart. 

     

    https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q023070_.htm

    When you create a message, if you initialize the message descriptor (MQMD) using the defaults, the persistence for the message is taken from the DefPersistence attribute of the queue specified in the MQOPEN command <<note if you are putting to an alias before the destination, it is that queue definition that is used>>.

     

    Alternatively, you can set the persistence of the message using the Persistence field of the MQMD structure to define the message as persistent or nonpersistent.

  • Dcompany
    Dcompany
    2 Posts

    Re: IBM MQ peristance property for non-persistent messages

    ‏2016-12-02T08:36:19Z  

    Yes, the definition of the queue only comes into play if the putting application chooses to use the default settings of the queue.  Otherwise, if the messages are put as non-persistent, those messages will be deleted upon qmgr restart. 

     

    https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q023070_.htm

    When you create a message, if you initialize the message descriptor (MQMD) using the defaults, the persistence for the message is taken from the DefPersistence attribute of the queue specified in the MQOPEN command <<note if you are putting to an alias before the destination, it is that queue definition that is used>>.

     

    Alternatively, you can set the persistence of the message using the Persistence field of the MQMD structure to define the message as persistent or nonpersistent.

    Hi..

    I believe as long non-persistence message sits inside persistence queue messages will not be lost . However if that message is moved to another queue as its behavior will change as you mentioned and as per IBM doc as well. I see that some messages were stored in the queue 10 years before are still exist even after restart. Have you faced this kinda scenario ?

  • ValerieLampkin
    ValerieLampkin
    3 Posts

    Re: IBM MQ peristance property for non-persistent messages

    ‏2016-12-02T14:08:01Z  
    • Dcompany
    • ‏2016-12-02T08:36:19Z

    Hi..

    I believe as long non-persistence message sits inside persistence queue messages will not be lost . However if that message is moved to another queue as its behavior will change as you mentioned and as per IBM doc as well. I see that some messages were stored in the queue 10 years before are still exist even after restart. Have you faced this kinda scenario ?

    No, no non-persistent message will not remain just because it sits in a queue with a default of persistent.  The message's persistence itself is what determines if a message is deleted after qmgr restart or not.

     

    If you have messages from 10 years ago then they were put as persistent messages and you would need to have an application read/consume those from the queue.  You may also be able to use the explorer GUI to remove them manually. 

  • fjb_saper
    fjb_saper
    240 Posts

    Re: IBM MQ peristance property for non-persistent messages

    ‏2017-01-02T14:25:35Z  

    No, no non-persistent message will not remain just because it sits in a queue with a default of persistent.  The message's persistence itself is what determines if a message is deleted after qmgr restart or not.

     

    If you have messages from 10 years ago then they were put as persistent messages and you would need to have an application read/consume those from the queue.  You may also be able to use the explorer GUI to remove them manually. 

    There is an added twist called NPM Quality or Non Persistent Message Quality. Depending on this setting Non Persistent Messages with the right quality attribute MAY survive a queue manager restart, but will not survive a queue manager crash.

    It is doubtful that such messages would survive for 10 years or more as the conditions to allow such a survival need to be optimal at all times...

    The currently accepted doctrine is to make messages persistent if you want / need them to survive.

    Updated on 2017-01-02T14:26:08Z at 2017-01-02T14:26:08Z by fjb_saper