List of usage examples for org.springframework.amqp.core MessageProperties getUserId
public String getUserId()
From source file:org.springframework.amqp.rabbit.support.RabbitUtils.java
public static BasicProperties extractBasicProperties(Message message, String charset) { if (message == null || message.getMessageProperties() == null) { return null; }/*from w ww . ja v a 2 s. c om*/ MessageProperties source = message.getMessageProperties(); BasicProperties target = new BasicProperties(); target.setHeaders(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()); MessageDeliveryMode deliveryMode = source.getDeliveryMode(); if (deliveryMode != null) { target.setDeliveryMode(MessageDeliveryMode.toInt(deliveryMode)); } target.setExpiration(source.getExpiration()); target.setPriority(source.getPriority()); target.setContentType(source.getContentType()); target.setContentEncoding(source.getContentEncoding()); byte[] correlationId = source.getCorrelationId(); if (correlationId != null && correlationId.length > 0) { try { target.setCorrelationId(new String(correlationId, charset)); } catch (UnsupportedEncodingException ex) { throw new AmqpUnsupportedEncodingException(ex); } } Address replyTo = source.getReplyTo(); if (replyTo != null) { target.setReplyTo(replyTo.toString()); } return target; }