Refine search
@Override public org.apache.activemq.artemis.api.core.Message setTimestamp(long timestamp) { if (properties == null) { properties = new Properties(); } properties.setCreationTime(new Date(timestamp)); return this; }
public int size() { return _impl.getReplyToGroupId() != null ? 13 : _impl.getGroupSequence() != null ? 12 : _impl.getGroupId() != null ? 11 : _impl.getCreationTime() != null ? 10 : _impl.getAbsoluteExpiryTime() != null ? 9 : _impl.getContentEncoding() != null ? 8 : _impl.getContentType() != null ? 7 : _impl.getCorrelationId() != null ? 6 : _impl.getReplyTo() != null ? 5 : _impl.getSubject() != null ? 4 : _impl.getTo() != null ? 3 : _impl.getUserId() != null ? 2 : _impl.getMessageId() != null ? 1 : 0; }
@Override public void setMessageId(Object messageId) { if(_properties == null) { if(messageId == null) { return; } _properties = new Properties(); } _properties.setMessageId(messageId); }
@Override public void setAddress(String to) { if(_properties == null) { if(to == null) { return; } _properties = new Properties(); } _properties.setTo(to); }
@Override public long getCreationTime() { return (_properties == null || _properties.getCreationTime() == null) ? 0l : _properties.getCreationTime().getTime(); }
@Override public void setExpiryTime(long absoluteExpiryTime) { if(_properties == null) { if(absoluteExpiryTime == 0l) { return; } _properties = new Properties(); } _properties.setAbsoluteExpiryTime(new Date(absoluteExpiryTime)); }
@Override public long getExpiryTime() { return (_properties == null || _properties.getAbsoluteExpiryTime() == null) ? 0l : _properties.getAbsoluteExpiryTime().getTime(); }
encodedHeaderSize = data.position(); if (header.getTtl() != null) { expiration = System.currentTimeMillis() + header.getTtl().intValue(); properties = (Properties) constructor.readValue(); if (properties.getAbsoluteExpiryTime() != null && properties.getAbsoluteExpiryTime().getTime() > 0) { expiration = properties.getAbsoluteExpiryTime().getTime();
private static ServerJMSMessage processProperties(ServerJMSMessage jms, Properties properties) throws Exception { if (properties != null) { if (properties.getMessageId() != null) { jms.setJMSMessageID(AMQPMessageIdHelper.INSTANCE.toMessageIdString(properties.getMessageId())); Binary userId = properties.getUserId(); if (userId != null) { jms.setStringProperty("JMSXUserID", new String(userId.getArray(), userId.getArrayOffset(), userId.getLength(), StandardCharsets.UTF_8)); if (properties.getTo() != null) { jms.setJMSDestination(new ServerDestination(properties.getTo())); if (properties.getSubject() != null) { jms.setJMSType(properties.getSubject()); if (properties.getReplyTo() != null) { jms.setJMSReplyTo(new ServerDestination(properties.getReplyTo())); if (properties.getCorrelationId() != null) { jms.setJMSCorrelationID(AMQPMessageIdHelper.INSTANCE.toCorrelationIdString(properties.getCorrelationId())); if (properties.getContentType() != null) { jms.setStringProperty(JMS_AMQP_CONTENT_TYPE, properties.getContentType().toString()); if (properties.getContentEncoding() != null) { jms.setStringProperty(JMS_AMQP_CONTENT_ENCODING, properties.getContentEncoding().toString()); if (properties.getCreationTime() != null) { jms.setJMSTimestamp(properties.getCreationTime().getTime());
assertNotNull("Properties section not present", properties); assertEquals("expected to value to be present", testToAddress, properties.getTo()); assertEquals("expected reply to value to be present", testReplyToAddress, properties.getReplyTo()); assertEquals("expected message id value to be present", testMessageId, properties.getMessageId()); assertEquals("expected correlation id value to be present", testCorrelationId, properties.getCorrelationId()); assertEquals("expected subject value to be present", testSubject, properties.getSubject()); assertEquals("expected group id value to be present", testGroupId, properties.getGroupId()); assertEquals("expected group sequence value to be present", UnsignedInteger.valueOf(testGroupSeq), properties.getGroupSequence()); assertEquals("expected reply to group id value to be present", testReplyToGroupId, properties.getReplyToGroupId()); assertEquals("expected content type value to be present", Symbol.valueOf(testContentType), properties.getContentType()); assertEquals("expected content encoding value to be present", Symbol.valueOf(testContentEncoding), properties.getContentEncoding()); assertEquals("expected creation time value to be present", testCreationTime, properties.getCreationTime().getTime()); assertEquals("expected absolute expiry time value to be present", testAbsExpiryTime, properties.getAbsoluteExpiryTime().getTime()); assertEquals("expected user id value to be present", new Binary(testUserId.getBytes(StandardCharsets.UTF_8)), properties.getUserId());
Properties properties = new Properties(); properties.setMessageId(message.getMessageId()); properties.setTo(targetPath); properties.setAbsoluteExpiryTime(message.getExpiryTimeUtc()); properties.setCorrelationId(message.getCorrelationId()); if (message.getUserId() != null) properties.setUserId(new Binary(message.getUserId().getBytes())); Binary binary = new Binary(message.getBytes());
@Override public void setUserId(byte[] userId) { if(userId == null) { if(_properties != null) { _properties.setUserId(null); } } else { if(_properties == null) { _properties = new Properties(); } byte[] id = new byte[userId.length]; System.arraycopy(userId, 0, id,0, userId.length); _properties.setUserId(new Binary(id)); } }
@Override public void setContentType(String contentType) { if(_properties == null) { if(contentType == null) { return; } _properties = new Properties(); } _properties.setContentType(Symbol.valueOf(contentType)); }
@Override public void setGroupSequence(long groupSequence) { if(_properties == null) { if(groupSequence == 0l) { return; } else { _properties = new Properties(); } } _properties.setGroupSequence(UnsignedInteger.valueOf((int) groupSequence)); }
@Override public void setContentEncoding(String contentEncoding) { if(_properties == null) { if(contentEncoding == null) { return; } _properties = new Properties(); } _properties.setContentEncoding(Symbol.valueOf(contentEncoding)); }
@Override public String getContentType() { return (_properties == null || _properties.getContentType() == null) ? null : _properties.getContentType().toString(); }
Properties properties = new Properties(); if(message.getMessageId() != null) properties.setMessageId(message.getMessageId()); Binary binary = new Binary(message.getBytes()); Section section = new Data(binary); outgoingMessage.setBody(section);
private boolean checkMessageProperties(AMQPMessage message, Map<String, Object> expectedProperties) { assertNotNull(message); assertNotNull(server.getNodeID()); assertNotNull(message.getConnectionID()); assertEquals(message.getAddress(), expectedProperties.get(ADDRESS)); assertEquals(message.isDurable(), expectedProperties.get(DURABLE)); Properties props = message.getProperties(); assertEquals(props.getCorrelationId(), expectedProperties.get(CORRELATION_ID)); assertEquals(props.getReplyTo(), expectedProperties.get(REPLY_TO)); assertEquals(props.getMessageId(), expectedProperties.get(MESSAGE_ID)); Header header = message.getHeader(); assertEquals(header.getDurable(), expectedProperties.get(DURABLE)); assertEquals(header.getTtl().toString(), expectedProperties.get(TIME_TO_LIVE).toString()); assertEquals(header.getPriority().toString(), expectedProperties.get(PRIORITY).toString()); return true; }
@Override public String getAddress() { return _properties == null ? null : _properties.getTo(); }
@Override public Object getMessageId() { return _properties == null ? null : _properties.getMessageId(); }