I am using IBM MQ API to connect to the queue to load my messages from a file. I use javax.jms.QueueSender to load the messages to my queue 'TEST.IBM.Q'.
I have a functionality to load the number of valid messages from a file to be loaded as the first message.
Example: Say I have a file called File1.txt:
Valid
Valid
Valid
Invalid
Valid
Here, I will load 5 messages to my queue like below,
Count-4
Valid
Valid
Valid
Valid
Currently, I am iterating throughout the file to find the number of valid messages and loading it in the start & iterating again to load the messages.
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?
Thanks in advance to everyone!!