@MarkyMark ah I see. You’re reading via JMS but have (as you said before) no control over the publishers.
If you read the message, that message object is immutable - because it represents what has been sent to you from the queue. That’s why you can’t change the DMQ property. We need another approach.
I’m not sure what benefit re-trying validation will offer? Re-sending messages like this is typically useful in the case of transient failures such as application failure and restart.
If you push the message directly back to the same queue, be aware that this will change message ordering. Sending the message to a GCP bucket would complicate your architecture, but I’m not sure what you do with messages on the DMQ.
I would suggest pushing the message directly to the DMQ itself, because it’s easy to trace what happens, the business logic is clear, and it can also be clear in your comments that you’re doing this because publishers are not setting the DMQ flag. That’s just my 2p, though ?