My application communicate with other system via IBM Websphere MQ. Sometime no message income to my queue but other system said They already sent to me. So I want to know how to keep history for all messages that income to my queue.
Keep in mind that it may still be coming across the network as the MQ architecture may have many middle-ware queues. Similarly, there's no requirement for a message to immediately get transmitted across a channel - the sender may batch up the messages and send them with a trigger.
The best way to ensure you log everything that arrives is to do this is with an interceptor queue.
This is the queue (let's call it A) that the channel writes to and, until this change, your application read from. You then have a transfer process the reads from A, logs the message then writes it to the second queue (B). This second queue is what your application now reads from.
You can put a logging statement at your end of the queue, so that as soon as you get the message, you dump the contents into a log. That way if the other system says they sent a message, all they have to do is tell you when, and you can look in your log and see if there's a message received from them at about that time.
The only other way I can think of would be to use a channel exit.