Updated Request & Reply JMS/MQRFH2 Messaging Scenario

The person on StackOverflow made a comment that I was using a static string as my reply message. Humm. Some times people cannot see the forest for the trees.

So, I have updated my sample Java/MQ (i.e. MQTest77.java) in this posting to do the following:

  • Connect to a remote queue manager
  • Open an input queue, get a message, close the queue
  • Extract the MQRFH2 variables
  • Take a checksum of the incoming message payload
  • Use the checksum as a seed value for the random number generator
  • Generate Powerball numbers and a create reply payload with that information
  • Open the output queue
  • Create a new reply message with the extracted RFH2 values and the reply payload then send the reply message
  • Close the output queue and disconnect from the queue manager

There you go, nothing static about the reply text in the reply message.

Although, this did feel like doing a lab assignment for a Java programming course. 🙂

And of course, if anyone wins the Powerball lottery or any other lottery with my code, I DO expect a 10% cut of the winnings!! 🙂

Regards,
Roger Lacroix
Capitalware Inc.

This entry was posted in IBM i (OS/400), IBM MQ, Linux, macOS (Mac OS X), Programming, Unix, Windows, z/OS.

Comments are closed.