I have a class:
MessageReceiver.java
that receives messages but can also produce messages indirectly (that then could potentially be redelivered to this class). I don't want to process messages that were sent with MessageReceiver.java in the stack trace. Is there a way to efficiently determine if the message I received was from MessageReceiver.java?
The following chain is possible:
MessageReceiver.java -> OtherClass.java -> MessageProducer.java -> MessageReceiver.java