message_0_8.getContent(body, 0);
body.flip();
Struct[] headers = new Struct[] { deliveryProps, messageProps };
BasicContentHeaderProperties properties =
(BasicContentHeaderProperties) message_0_8.getContentHeaderBody().properties;
final AMQShortString exchange = message_0_8.getMessagePublishInfo().getExchange();
if(exchange != null)
{
deliveryProps.setExchange(exchange.toString());
}
deliveryProps.setExpiration(message_0_8.getExpiration());
deliveryProps.setImmediate(message_0_8.isImmediate());
deliveryProps.setPriority(MessageDeliveryPriority.get(properties.getPriority()));
deliveryProps.setRedelivered(entry.isRedelivered());
deliveryProps.setRoutingKey(message_0_8.getRoutingKey());
deliveryProps.setTimestamp(properties.getTimestamp());
messageProps.setContentEncoding(properties.getEncodingAsString());
messageProps.setContentLength(size);
if(properties.getAppId() != null)
{
messageProps.setAppId(properties.getAppId().getBytes());
}
messageProps.setContentType(properties.getContentTypeAsString());
if(properties.getCorrelationId() != null)
{
messageProps.setCorrelationId(properties.getCorrelationId().getBytes());
}
// TODO - ReplyTo
if(properties.getUserId() != null)
{
messageProps.setUserId(properties.getUserId().getBytes());
}
FieldTable fieldTable = properties.getHeaders();
final Map<String, Object> appHeaders = FieldTable.convertToMap(fieldTable);
messageProps.setApplicationHeaders(appHeaders);