Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tried out samples and order of messages not maintained

 
Mike Birken
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tested out some of the samples from the JMS tutorial on Sun's site and I got some strange results. The first example in there creates a queue, a sender, and a receiver. The sender enqueses 10 messages (strings "1" through "10"). And the receiver dequeues and displays everything it gets. I was impressed with the fact that I can enqueue 10 messages and start the receiver later and still get my 10 messages back. Then I tried this: (1) run sender (i.e. enqueue "1" through "10"), (2) run sender again (i.e. enqueue "1" through "10"), (3) run receiver. This time it printed "1", "1", "2", "2", ... , "10", "10" instead of "1", "2", ... , "10", "1", "2", ... "10". Why isn't the order of the messages enqueued maintained?
- Mike
 
Don Schaefer
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What JMS provider are you using?
 
Mike Birken
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun's
- Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic