use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.
the class AMQPSequenceMessageFactory method create.
public AMQPMessage create(int sequenceNo) throws Exception {
AMQPMessage msg = new AMQPMessage();
List list = new ArrayList();
list.add(new AMQPString("key1"));
list.add(new AMQPLong(Integer.MAX_VALUE + 1));
list.add(new AMQPString("key3"));
list.add(new AMQPLong(Integer.MAX_VALUE + 2));
msg.addAmqpSequence(new AmqpSequence(list));
return msg;
}
use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.
the class AMQPValueByteMessageFactory method createReplyMessage.
public AMQPMessage createReplyMessage(AMQPMessage request) throws Exception {
AMQPMessage reply = new AMQPMessage();
reply.setAmqpValue(new AmqpValue(new AMQPByte((byte) 100)));
return reply;
}
use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.
the class AMQPValueByteMessageFactory method create.
public AMQPMessage create(int sequenceNo) throws Exception {
AMQPMessage msg = new AMQPMessage();
msg.setAmqpValue(new AmqpValue(new AMQPByte((byte) 100)));
return msg;
}
use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.
the class AMQPValueByteMessageFactory method verify.
public void verify(AMQPMessage message) throws Exception {
AmqpValue value = message.getAmqpValue();
if (value == null)
throw new Exception(("verify - no AmqpValue section found!"));
AMQPType t = value.getValue();
if (!(t instanceof AMQPByte))
throw new Exception(("verify - AmqpValue does not contain an AmqpByte!"));
if (((AMQPByte) t).getValue() != (byte) 100)
throw new Exception("verify - invalid value: " + ((AMQPByte) t).getValue());
}
use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.
the class AMQPValueMapMessageFactory method createReplyMessage.
public AMQPMessage createReplyMessage(AMQPMessage request) throws Exception {
AMQPMessage reply = new AMQPMessage();
Map map = ((AMQPMap) request.getAmqpValue().getValue()).getValue();
map.put(new AMQPString("REPLY"), new AMQPString("REPLY"));
reply.setAmqpValue(new AmqpValue(new AMQPMap(map)));
return reply;
}
Aggregations