use of com.swiftmq.amqp.v100.generated.transport.definitions.SequenceNo 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.generated.transport.definitions.SequenceNo in project swiftmq-ce by iitsoftware.
the class JMSMappingInboundTransformer method transformProperties.
protected void transformProperties(Properties properties, final MessageImpl jmsMessage, final DestinationFactory destinationFactory) throws Exception {
if (overwriteMessageId) {
jmsMessage.setJMSMessageID(nextMsgId());
} else {
MessageIdIF messageIdIF = properties.getMessageId();
if (messageIdIF != null)
messageIdIF.accept(new MessageIdVisitor() {
public void visit(MessageIdUlong messageIdUlong) {
try {
jmsMessage.setJMSMessageID(String.valueOf(messageIdUlong.getValue()));
} catch (JMSException e) {
}
}
public void visit(MessageIdUuid messageIdUuid) {
try {
jmsMessage.setJMSMessageID(String.valueOf(messageIdUuid.getValue()));
} catch (JMSException e) {
}
}
public void visit(MessageIdBinary messageIdBinary) {
try {
jmsMessage.setJMSMessageID(new String(messageIdBinary.getValue()));
} catch (JMSException e) {
}
}
public void visit(MessageIdString messageIdString) {
try {
jmsMessage.setJMSMessageID(messageIdString.getValue());
} catch (JMSException e) {
}
}
});
}
AMQPBinary userId = properties.getUserId();
if (userId != null)
jmsMessage.setStringProperty(MessageImpl.PROP_USER_ID, new String(userId.getValue(), "ISO-8859-1"));
AddressIF to = properties.getTo();
if (to != null) {
jmsMessage.setJMSDestination(destinationFactory.create(to));
to.accept(new AddressVisitor() {
public void visit(AddressString addressString) {
try {
jmsMessage.setStringProperty(Util.PROP_AMQP_TO_ADDRESS, addressString.getValue());
} catch (JMSException e) {
}
}
});
}
AMQPString subject = properties.getSubject();
if (subject != null)
jmsMessage.setStringProperty(prefixVendor + "Subject", subject.getValue());
AddressIF replyTo = properties.getReplyTo();
if (replyTo != null)
jmsMessage.setJMSReplyTo(destinationFactory.create(replyTo));
MessageIdIF correlationIdIF = properties.getCorrelationId();
if (correlationIdIF != null)
correlationIdIF.accept(new MessageIdVisitor() {
public void visit(MessageIdUlong messageIdUlong) {
try {
jmsMessage.setJMSCorrelationID(String.valueOf(messageIdUlong.getValue()));
} catch (JMSException e) {
}
}
public void visit(MessageIdUuid messageIdUuid) {
try {
jmsMessage.setJMSCorrelationID(String.valueOf(messageIdUuid.getValue()));
} catch (JMSException e) {
}
}
public void visit(MessageIdBinary messageIdBinary) {
try {
jmsMessage.setJMSCorrelationID(new String(messageIdBinary.getValue()));
} catch (JMSException e) {
}
}
public void visit(MessageIdString messageIdString) {
try {
jmsMessage.setJMSCorrelationID(messageIdString.getValue());
} catch (JMSException e) {
}
}
});
AMQPSymbol contentType = properties.getContentType();
if (contentType != null)
jmsMessage.setStringProperty(prefixVendor + "ContentType", contentType.getValue());
AMQPSymbol contentEncoding = properties.getContentEncoding();
if (contentEncoding != null)
jmsMessage.setStringProperty(prefixVendor + "ContentEncoding", contentEncoding.getValue());
AMQPTimestamp ts = properties.getAbsoluteExpiryTime();
if (ts != null)
jmsMessage.setJMSExpiration(ts.getValue());
AMQPTimestamp ct = properties.getCreationTime();
if (ct != null)
jmsMessage.setJMSTimestamp(ct.getValue());
AMQPString groupId = properties.getGroupId();
if (groupId != null)
jmsMessage.setStringProperty(Util.PROP_GROUP_ID, groupId.getValue());
SequenceNo groupSeq = properties.getGroupSequence();
if (groupSeq != null)
jmsMessage.setLongProperty(Util.PROP_GROUP_SEQ, groupSeq.getValue());
AMQPString replyToGroupId = properties.getReplyToGroupId();
if (replyToGroupId != null)
jmsMessage.setStringProperty(prefixVendor + "ReplyToGroupID", replyToGroupId.getValue());
}
Aggregations