Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Handling Large MQ objects in Java.

Ranch Hand
Posts: 133
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am working on reading large MQ messages in Java and processing + writing the contents of MQ message to a file.

The code I am writing is multi-threaded and can process multiple messages in parallel.

The writing application writes (PUT) large MQ message to the queue using Segmentation+Grouping.

Now, while reading below steps take place.

1.Set appropriate values for MQGetMessageOptions.

2. Initializing MQQueue  - serverFileQueue and MQMessage - reqMessage.

3. Invoking get method for MQQueue by passing reqMessage and getGroupMsgOptions.

4. Checking the MQ message flags in a while loop to identify last segment of last message in group.

5. Write the message contents to a file using .

My question is, if the MQ message is too large, should the code be getting java.lang.OutOfMemoryError.

I am trying to understand if step 3 . would load entire MQ Message in memory? OR only segments would be loaded hence no need to worry about  java.lang.OutOfMemoryError.

Your help is much appreciated!


WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic