MessageProperties messageProps = null;
if(serverMsg instanceof MessageTransferMessage)
{
MessageTransferMessage msg = (MessageTransferMessage) serverMsg;
Struct[] headers;
if(msg.getHeader() == null)
{
headers = EMPTY_STRUCT_ARRAY;
}
else
{
headers = msg.getHeader().getStructs();
}
ArrayList<Struct> newHeaders = new ArrayList<Struct>(headers.length);
DeliveryProperties origDeliveryProps = null;
for(Struct header : headers)
{
if(header instanceof DeliveryProperties)
{
origDeliveryProps = (DeliveryProperties) header;
}
else
{
if(header instanceof MessageProperties)
{
messageProps = (MessageProperties) header;
}
newHeaders.add(header);
}
}
deliveryProps = new DeliveryProperties();
if(origDeliveryProps != null)
{
if(origDeliveryProps.hasDeliveryMode())
{
deliveryProps.setDeliveryMode(origDeliveryProps.getDeliveryMode());
}
if(origDeliveryProps.hasExchange())
{
deliveryProps.setExchange(origDeliveryProps.getExchange());
}
if(origDeliveryProps.hasExpiration())
{
deliveryProps.setExpiration(origDeliveryProps.getExpiration());
}
if(origDeliveryProps.hasPriority())
{
deliveryProps.setPriority(origDeliveryProps.getPriority());
}
if(origDeliveryProps.hasRoutingKey())
{
deliveryProps.setRoutingKey(origDeliveryProps.getRoutingKey());
}
if(origDeliveryProps.hasTimestamp())
{
deliveryProps.setTimestamp(origDeliveryProps.getTimestamp());
}
}
deliveryProps.setRedelivered(entry.isRedelivered());
newHeaders.add(deliveryProps);
if(_trace != null && messageProps == null)
{
messageProps = new MessageProperties();
newHeaders.add(messageProps);
}
Header header = new Header(newHeaders);
xfr = new MessageTransfer(_destination,_acceptMode,_acquireMode,header,msg.getBody());
}
else if(serverMsg instanceof AMQMessage)
{
AMQMessage message_0_8 = (AMQMessage) serverMsg;
deliveryProps = new DeliveryProperties();