I think the deadlock problem is solved. The problem was is the
onMessageReceived being a synchronized method.