For some reasons, my producer sends at the same time X messages to rabbit MQ. These messages are just notification that say "i update something, do your stuff"
But my consumer shall not call his callback for all messages, only one (and not wait all messages indefinitely). Is it possible to do that?
It depends on the specific details so I'll try to address some example scenarios. I assume messages are not all created equal and the last one is the right one (e.g. updated data).

X is fixed, the time delta between first and last message is m seconds 99% of the time, processing a message more than one time is ok
In this case you know you'll get not 1 but n messages, so every time you receive a new (unique) message, you queue it up and when you have received n you can process it; if the process takes up more than m seconds you process it right away; if a late message arrives it will processed again after m seconds timeout with no problem.

X is variable, the time delta between first and last message is m seconds < 50% of the time, processing a message more than one time is ok
Same as previous case, you just need to tune the timeout carefully to achieve acceptable time-to-message-processed time while still keeping re-processing of messages low enough.

processing a message more than once is NOT ok, the last message after a timeout is the good one
I relaxed the requirement to process the last message and made it into the last message in a time interval.
This way you can queue messages up and wait for the last in the allowed time frame, then process it. You'll also need to keep a cache of processed messages so late ones can get recognized and discarded without being re-processed, as that would not be ok.


These are some scenarios, which can of course be combined to achieve more possibilities, but in the end it all depends on the specific details on how messages are generated and delivered and the requirements on which message gets to be processed.
Wait all message and run callback