final QueueSession session = sessionProvider.getSession(httpServletRequest.getSession(),
httpServletRequest.getHeader(ClientMessageBus.REMOTE_QUEUE_ID_HEADER));
BufferedReader reader = httpServletRequest.getReader();
StringAppender sb = new StringAppender(httpServletRequest.getContentLength());
CharBuffer buffer = CharBuffer.allocate(10);
int read;
while ((read = reader.read(buffer)) > 0) {
buffer.rewind();
for (; read > 0; read--) {
sb.append(buffer.get());
}
buffer.rewind();
}
Message m = createCommandMessage(session, sb.toString());
if (m != null) {
service.store(m);
}
pollQueue(service.getBus().getQueue(session), httpServletRequest, httpServletResponse);