Menu

#400 Issue with MessageQueue.getMessages()

Messages
open
Zhang Ze
None
2
2019-01-28
2018-01-23
Pritam
No

MessageQueue.getMessages() is not returning anything for subsequent call.
This issue happens with newer version of JTOpen library. Older libraries (8.x) works fine.

eg, First Run

if (program.run()){
Enumeration en = queue.getMessages();
//en gets the messages from queue
}

Second run

if (program.run()){
Enumeration en = queue.getMessages();
//en doesn’t get messages from queue
}

Third run
if (program.run()){
Enumeration en = queue.getMessages();
//en gets the messages from queue
}

Discussion

  • John Eberhard

    John Eberhard - 2018-02-19
    • assigned_to: wanghuiq
     
  • wanghuiq

    wanghuiq - 2018-02-23
    • assigned_to: wanghuiq --> Zhang Ze
     
  • Zhang Ze

    Zhang Ze - 2018-02-23

    Does 8.7 or 8.6 work fine? we changed the class in 8.6.

     
  • Pritam

    Pritam - 2018-03-06

    This seems to be working fine till 9.1.
    Observed issue in 9.4

     
  • Zhang Ze

    Zhang Ze - 2019-01-28

    I wrote a sample code to get a message queue messages. I can get the messages from the queue for every loops, it works with latest JTOpen. Is there any different from your program?
    for (int i = 0; i < 3; i++) {
    try {
    Enumeration en = q.getMessages();
    System.out.println("==== Enumeration loop " + i + " ====");
    while (en.hasMoreElements()){
    System.out.println(en.nextElement());
    } catch (Exception e) {
    }
    }

     

Log in to post a comment.

MongoDB Logo MongoDB