public void onFrame(StompFrame frame) { AsciiBuffer action = frame.action(); if (action.startsWith(MESSAGE)) { try { StompJmsMessage msg = StompTranslator.convert(frame); msg.setFrame(frame); msg.setReadOnlyBody(true); msg.setReadOnlyProperties(true); StompJmsMessageListener l = this.listener; if (l != null) { l.onMessage(msg); } } catch (JMSException e) { handleException(e); } } else { handleException(new ProtocolException("Unknown STOMP action: " + action)); } }
public void onFrame(StompFrame frame) { AsciiBuffer action = frame.action(); if (action.startsWith(MESSAGE)) { try { StompJmsMessage msg = StompTranslator.convert(frame); msg.setFrame(frame); msg.setReadOnlyBody(true); msg.setReadOnlyProperties(true); StompJmsMessageListener l = this.listener; if (l != null) { l.onMessage(msg); } } catch (JMSException e) { handleException(e); } } else { handleException(new ProtocolException("Unknown STOMP action: " + action)); } }
private void processStompFrame(StompFrame frame) { getDispatchQueue().assertExecuting(); AsciiBuffer action = frame.action(); if (action.equals(RECEIPT)) { AsciiBuffer id = frame.getHeader(RECEIPT_ID); if (id != null) { Callback<StompFrame> cb = this.requests.remove(id); if (cb != null) { cb.onSuccess(frame); } else { if( !toReceiver(frame) ) { processFailure(new ProtocolException("Stomp Response without a valid receipt id: " + id + " for frame " + frame)); } } } else { processFailure(new ProtocolException("Stomp Response with no receipt id: " + frame)); } } else if (action.startsWith(ERROR)) { processFailure(new ProtocolException("Received an error: " + frame.errorMessage())); } else { toReceiver(frame); } }
private void processStompFrame(StompFrame frame) { getDispatchQueue().assertExecuting(); AsciiBuffer action = frame.action(); if (action.equals(RECEIPT)) { AsciiBuffer id = frame.getHeader(RECEIPT_ID); if (id != null) { Callback<StompFrame> cb = this.requests.remove(id); if (cb != null) { cb.onSuccess(frame); } else { if( !toReceiver(frame) ) { processFailure(new ProtocolException("Stomp Response without a valid receipt id: " + id + " for frame " + frame)); } } } else { processFailure(new ProtocolException("Stomp Response with no receipt id: " + frame)); } } else if (action.startsWith(ERROR)) { processFailure(new ProtocolException("Received an error: " + frame.errorMessage())); } else { toReceiver(frame); } }