title: Is it possible to load a message in Start of MQ Queue in java
body: <p>I am using IBM MQ API to connect to the queue to load my messages from a file. I use  <code>javax.jms.QueueSender</code> to load the messages to my queue 'TEST.IBM.Q'.</p>
  
  <p>I have a functionality to load the number of valid messages from a file to be loaded as the first message.</p>
  
  <p>Example:
  Say I have a file called File1.txt:</p>
  
  <pre><code>Valid
  Valid
  Valid
  Invalid
  Valid
  </code></pre>
  
  <p>Here, I will load 5 messages to my queue like below,</p>
  
  <pre><code>Count-4
  Valid
  Valid
  Valid
  Valid
  </code></pre>
  
  <p>Currently, I am iterating throughout the file to find the number of valid messages and loading it in the start &amp; iterating again to load the messages.</p>
  
  <p>I know, its a bad way of doing it. Some one could you please let me know, Is there any possibility to load a message in the start of the queue once everything is done?</p>
  
  <p>Thanks in advance to everyone!!</p>