MessageTransfer xfr;
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
{
newHeaders.add(header);
}
}
DeliveryProperties 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());
}
}
deliveryProps.setRedelivered(entry.isRedelivered());
newHeaders.add(deliveryProps);
Header header = new Header(newHeaders);
xfr = new MessageTransfer(_destination,_acceptMode,_acquireMode,header,msg.getBody());
}
else
{
AMQMessage message_0_8 = (AMQMessage) serverMsg;
DeliveryProperties deliveryProps = new DeliveryProperties();