Hello All,
I am trying to alter a piece of code which works with IBM MQ .
While invoking the get(...) method on the mq, we can provide wait interval , i.e. for how much time the
thread will wait for a message to arrive in the queue.
When this time interval is too long , we want to stop this perticular thread , from waiting on mq.get(..) method (in some user initiated stoppage)
(There is some other logic that comes after the mq.get(), and we just intend to interrupt the thread to end waiting on mq.get() call)
One of the probable solutions would be invoking Thread.interrupt(); on the thread which has been waiting for mq.get(..) to completed.
What I am trying to understand here is , if this is a proper approach and can this be achieved in a better way?
Your help would be very much helpful on this one.
Thank you,
Rohit