Probably the "fix" would be to stop asynchronously (fork a thread) to make the JMX call. Note: I believe "stop" is waiting for your onMessage to exit before it returns, thus that's why it won't seemingly stop.