@Override public void dispatchForSync(Message msg) { if (msg != null) { final MessageHandler handler = msg.getMessageHandler(); // cant be null NonBlockingSession session = (NonBlockingSession) handler; MessageQueue queue = session.getSendSyncQueue(); if (queue != null) { queue.add(msg); } else { // @TODO add ReusableString write( ReusableString buf ) to Message and log details // should NEVER happen _log.error(MISSING_HANDLER, ((Session) handler).getComponentId()); } } }
@Override public void dispatch(final Message msg) { if (msg != null) { final MessageHandler handler = msg.getMessageHandler(); final NonBlockingSession session = (NonBlockingSession) handler; final MessageQueue queue = session.getSendQueue(); if (queue != null) { queue.add(msg); } else { // should NEVER happen ReusableString s = TLC.instance().pop(); s.copy(((Session) handler).getComponentId()) .append(": Missing Queue, unable to dispatch : "); msg.dump(s); _log.error(MISSING_HANDLER, s); TLC.instance().pushback(s); } } }