AMQP-175: Upgrade to rabbit 2.5.0

This commit is contained in:
Dave Syer
2011-06-27 12:51:48 +01:00
parent 7477d4d046
commit 33ceb3616b
3 changed files with 18 additions and 18 deletions

View File

@@ -17,7 +17,7 @@
<org.mockito.version>1.8.4</org.mockito.version>
<org.codehaus.jackson.version>1.4.3</org.codehaus.jackson.version>
<org.erlang.otp.version>1.5.3</org.erlang.otp.version>
<com.rabbitmq.version>2.3.1</com.rabbitmq.version>
<com.rabbitmq.version>2.5.0</com.rabbitmq.version>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<profiles>

View File

@@ -92,26 +92,26 @@ public class DefaultMessagePropertiesConverter implements MessagePropertiesConve
}
public BasicProperties fromMessageProperties(final MessageProperties source, final String charset) {
BasicProperties target = new BasicProperties();
target.setHeaders(this.convertHeadersIfNecessary(source.getHeaders()));
target.setTimestamp(source.getTimestamp());
target.setMessageId(source.getMessageId());
target.setUserId(source.getUserId());
target.setAppId(source.getAppId());
target.setClusterId(source.getClusterId());
target.setType(source.getType());
BasicProperties.Builder target = new BasicProperties.Builder();
target.headers(this.convertHeadersIfNecessary(source.getHeaders()));
target.timestamp(source.getTimestamp());
target.messageId(source.getMessageId());
target.userId(source.getUserId());
target.appId(source.getAppId());
target.clusterId(source.getClusterId());
target.type(source.getType());
MessageDeliveryMode deliveryMode = source.getDeliveryMode();
if (deliveryMode != null) {
target.setDeliveryMode(MessageDeliveryMode.toInt(deliveryMode));
target.deliveryMode(MessageDeliveryMode.toInt(deliveryMode));
}
target.setExpiration(source.getExpiration());
target.setPriority(source.getPriority());
target.setContentType(source.getContentType());
target.setContentEncoding(source.getContentEncoding());
target.expiration(source.getExpiration());
target.priority(source.getPriority());
target.contentType(source.getContentType());
target.contentEncoding(source.getContentEncoding());
byte[] correlationId = source.getCorrelationId();
if (correlationId != null && correlationId.length > 0) {
try {
target.setCorrelationId(new String(correlationId, charset));
target.correlationId(new String(correlationId, charset));
}
catch (UnsupportedEncodingException ex) {
throw new AmqpUnsupportedEncodingException(ex);
@@ -119,9 +119,9 @@ public class DefaultMessagePropertiesConverter implements MessagePropertiesConve
}
Address replyTo = source.getReplyTo();
if (replyTo != null) {
target.setReplyTo(replyTo.toString());
target.replyTo(replyTo.toString());
}
return target;
return target.build();
}
private Map<String, Object> convertHeadersIfNecessary(Map<String, Object> headers) {

View File

@@ -250,7 +250,7 @@ public class MulticastMain {
this.message = new byte[minMsgSize];
}
public void handleBasicReturn(int replyCode, String replyText, String exchange, String routingKey,
public void handleReturn(int replyCode, String replyText, String exchange, String routingKey,
AMQP.BasicProperties properties, byte[] body) throws IOException {
logBasicReturn();
}