use of com.generallycloud.baseio.container.jms.MapByteMessage in project baseio by generallycloud.
the class FixedMessageConsumer method onReceive.
@Override
public void onReceive(Message message) {
int msgType = message.getMsgType();
if (Message.TYPE_MAP == msgType) {
MapMessage m = (MapMessage) message;
String eventName = m.getParameter("eventName");
OnMappedMessage onMessage = onMappedMessages.get(eventName);
if (onMessage == null) {
return;
}
onMessage.onReceive(m);
} else if (Message.TYPE_MAP_BYTE == msgType) {
MapByteMessage m = (MapByteMessage) message;
String eventName = m.getParameter("eventName");
OnMappedMessage onMessage = onMappedMessages.get(eventName);
if (onMessage == null) {
return;
}
onMessage.onReceive(m);
} else if (Message.TYPE_TEXT == msgType) {
if (onTextMessage != null) {
onTextMessage.onReceive((TextMessage) message);
}
} else if (Message.TYPE_TEXT_BYTE == msgType) {
if (onTextByteMessage != null) {
onTextByteMessage.onReceive((TextByteMessage) message);
}
} else if (Message.TYPE_ERROR == msgType) {
if (onErrorMessage != null) {
onErrorMessage.onReceive((ErrorMessage) message);
}
} else if (Message.TYPE_NULL == msgType) {
if (onNullMessage != null) {
onNullMessage.onReceive((NullMessage) message);
}
}
}
use of com.generallycloud.baseio.container.jms.MapByteMessage in project baseio by generallycloud.
the class MapByteMessageDecoder method decode.
@Override
public Message decode(ParamedProtobaseFuture future) {
Parameters param = future.getParameters();
String messageId = param.getParameter("msgId");
String queueName = param.getParameter("queueName");
JSONObject map = param.getJSONObject("map");
byte[] array = future.getReadBinary();
return new MapByteMessage(messageId, queueName, map, array);
}
Aggregations