Add exception catch to addMessageToWriteQueue method.