0

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!!

1
  • Just add it to a different queue. Read from the hi-priority queue first; when that's empty, read from the low priority queue. Commented Mar 3, 2016 at 7:09

1 Answer 1

2

By default, in IBM MQ, messages are delivered on a priority basis, higher priority messages are delivered first followed by lower priority messages.

You can make use of this feature. Set different priorities for valid and invalid messages. If you want the valid messages to be delivered first, then set a higher priority for valid messages and lower priority to invalid messages.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks much. I will make use of this. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.