List of usage examples for org.springframework.amqp.rabbit.support Delivery getProperties
public BasicProperties getProperties()
From source file:org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.java
/** * If this is a non-POISON non-null delivery simply return it. If this is * POISON we are in shutdown mode, throw shutdown. If delivery is null, we * may be in shutdown mode. Check and see. * // w w w. ja v a2 s.c o m * @throws InterruptedException */ private Message handle(Delivery delivery) throws InterruptedException { if ((delivery == null && shutdown != null)) { throw shutdown; } if (delivery == null) { return null; } byte[] body = delivery.getBody(); Envelope envelope = delivery.getEnvelope(); MessageProperties messageProperties = this.messagePropertiesConverter .toMessageProperties(delivery.getProperties(), envelope, "UTF-8"); messageProperties.setMessageCount(0); Message message = new Message(body, messageProperties); if (logger.isDebugEnabled()) { logger.debug("Received message: " + message); } deliveryTags.add(messageProperties.getDeliveryTag()); int retryTimes = getRequeueTimes(message); retryDeliveryTags.put(messageProperties.getDeliveryTag(), ++retryTimes); return message; }