private Map<String, String> buildAttributes(final BasicProperties properties) { final Map<String, String> attributes = new HashMap<>(); addAttribute(attributes, ATTRIBUTES_PREFIX + "appId", properties.getAppId()); addAttribute(attributes, ATTRIBUTES_PREFIX + "contentEncoding", properties.getContentEncoding()); addAttribute(attributes, ATTRIBUTES_PREFIX + "contentType", properties.getContentType()); addAttribute(attributes, ATTRIBUTES_PREFIX + "headers", properties.getHeaders()); addAttribute(attributes, ATTRIBUTES_PREFIX + "deliveryMode", properties.getDeliveryMode()); addAttribute(attributes, ATTRIBUTES_PREFIX + "priority", properties.getPriority()); addAttribute(attributes, ATTRIBUTES_PREFIX + "correlationId", properties.getCorrelationId()); addAttribute(attributes, ATTRIBUTES_PREFIX + "replyTo", properties.getReplyTo()); addAttribute(attributes, ATTRIBUTES_PREFIX + "expiration", properties.getExpiration()); addAttribute(attributes, ATTRIBUTES_PREFIX + "messageId", properties.getMessageId()); addAttribute(attributes, ATTRIBUTES_PREFIX + "timestamp", properties.getTimestamp() == null ? null : properties.getTimestamp().getTime()); addAttribute(attributes, ATTRIBUTES_PREFIX + "type", properties.getType()); addAttribute(attributes, ATTRIBUTES_PREFIX + "userId", properties.getUserId()); addAttribute(attributes, ATTRIBUTES_PREFIX + "clusterId", properties.getClusterId()); return attributes; }
exchange.getIn().setHeader(RabbitMQConstants.APP_ID, properties.getAppId()); if (properties.getClusterId() != null) { exchange.getIn().setHeader(RabbitMQConstants.CLUSTERID, properties.getClusterId());
target.setReceivedUserId(source.getUserId()); target.setAppId(source.getAppId()); target.setClusterId(source.getClusterId()); target.setType(source.getType()); Integer deliveryMode = source.getDeliveryMode();
target.setReceivedUserId(source.getUserId()); target.setAppId(source.getAppId()); target.setClusterId(source.getClusterId()); target.setType(source.getType()); Integer deliveryMode = source.getDeliveryMode();
/** * Construct a new message * * @param consumerTag the <i>consumer tag</i> associated with the consumer * @param envelope packaging data for the message * @param properties content header data for the message * @param body the message body (opaque, client-specific byte array) */ RabbitMQMessageImpl(byte[] body, String consumerTag, com.rabbitmq.client.Envelope envelope, AMQP.BasicProperties properties) { this.body = Buffer.buffer(body); this.consumerTag = consumerTag; this.envelope = new EnvelopeImpl(envelope.getDeliveryTag(), envelope.isRedeliver(), envelope.getExchange(), envelope.getRoutingKey()); this.properties = new BasicPropertiesImpl( properties.getContentType(), properties.getContentEncoding(), properties.getHeaders(), properties.getDeliveryMode(), properties.getPriority(), properties.getCorrelationId(), properties.getReplyTo(), properties.getExpiration(), properties.getMessageId(), properties.getTimestamp(), properties.getType(), properties.getUserId(), properties.getAppId(), properties.getClusterId() ); }
public static JsonObject toJson( AMQP.BasicProperties properties ) { if ( properties == null ) { return null; } JsonObject json = new JsonObject(); put( "contentType", properties.getContentType(), json ); put( "contentEncoding", properties.getContentEncoding(), json ); put( "headers", convertMapLongStringToString( properties.getHeaders() ), json ); put( "deliveryMode", properties.getDeliveryMode(), json ); put( "priority", properties.getPriority(), json ); put( "correlationId", properties.getCorrelationId(), json ); put( "replyTo", properties.getReplyTo(), json ); put( "expiration", properties.getExpiration(), json ); put( "messageId", properties.getMessageId(), json ); put( "timestamp", properties.getTimestamp(), json ); put( "type", properties.getType(), json ); put( "userId", properties.getUserId(), json ); put( "appId", properties.getAppId(), json ); put( "clusterId", properties.getClusterId(), json ); return json; }
private DeliveredMessage(QueueingConsumer.Delivery delivery) { super(delivery.getBody()); redelivery = delivery.getEnvelope().isRedeliver(); deliveryTag = delivery.getEnvelope().getDeliveryTag(); routingKey = delivery.getEnvelope().getRoutingKey(); exchange = delivery.getEnvelope().getExchange(); className = delivery.getProperties().getClassName(); clusterId = delivery.getProperties().getClusterId(); contentEncoding = delivery.getProperties().getContentEncoding(); contentType = delivery.getProperties().getContentType(); correlationId = delivery.getProperties().getCorrelationId(); deliveryMode = delivery.getProperties().getDeliveryMode(); expiration = delivery.getProperties().getExpiration(); headers = delivery.getProperties().getHeaders(); messageId = delivery.getProperties().getMessageId(); priority = delivery.getProperties().getPriority(); replyTo = delivery.getProperties().getReplyTo(); timestamp = delivery.getProperties().getTimestamp(); type = delivery.getProperties().getType(); userId = delivery.getProperties().getUserId(); }
public static MessageProperties valueOf(BasicProperties bp) { MessageProperties mp = new MessageProperties(); mp.setAppId(bp.getAppId()); mp.setClusterId(bp.getClusterId()); mp.setContentEncoding(bp.getContentEncoding()); mp.setContentType(bp.getContentType()); mp.setCorrelationId(bp.getCorrelationId()); mp.setDeliveryMode(bp.getDeliveryMode()); mp.setExpiration(bp.getExpiration()); mp.setHeaders(bp.getHeaders()); mp.setMessageId(bp.getMessageId()); mp.setPriority(bp.getPriority()); mp.setReplyTo(bp.getReplyTo()); mp.setTimestamp(bp.getTimestamp()); mp.setType(bp.getType()); mp.setUserId(bp.getUserId()); return mp; }