There are several problems/issues with what you are asking. Also, in the future, just post your code and then tag the code using the 'code' tag rather than posting a screenshot.
First, you do realize that if another consumer is performing a destructive get on the same queue then your application may never get to see that particular message. There are several ways for MQ or an API Exit to duplicate every message to another queue (backup queue). (1) Pub/Sub, (2) Stream queue (9.3) or a vendor product like MQ Message Replication.
As FB pointed out, there are 2 types of MQGET operations: non-destructive get (browse) and destructive get.
Third, the MQ JAR files you listed are not the complete/required list of MQ JAR files for a Java (non-JMS) application. You should use the com.ibm.mq.allclient.jar file as it is self-contained and was first available in IBM MQ v8.0.
Four, nothing in MQ will allow you to resume consuming messages at a particular message (i.e. 501) of a queue. You would need to code this.
Fifth, how often does your application crash or suddenly stop working? Because this is a simple type of application and should not be crashing.
Sixth, you haven't said what problem you are trying to solve. I can suggest several solutions, but without the context of your problem, I cannot give you a proper answer.
------------------------------
Roger Lacroix
CTO
Capitalware Inc.
London ON Canada
https://capitalware.com
------------------------------
Original Message:
Sent: Wed May 10, 2023 02:09 AM
From: Ranjitha YM
Subject: Websphere MQ Realtime and Restart :: MQ Get Operation
Hi Team,
We have the following requirement Can you please help us to get the solution?
We want to run the get messages operation continuously, we are able to do it with the below operation. The task is continuously and it's reading every new message. we are able to achieve realtime data read.

our requirement is if this real-time operation fails for any reason
EX: we have 500 messages and we run the real-time job, it reads all the 500 messages and if we add a new message, it will read a new message also and it keeps running(a total of 501 messages are read). If this Job fails for any reason and If we restart this job, the Job should start reading from 502 instead of all messages.
How to achieve this? Can you please help us here? we are using the following jars

------------------------------
Ranjitha YM
------------------------------