@Override public String toString() { return "AMQPMessage [durable=" + isDurable() + ", messageID=" + getMessageID() + ", address=" + getAddress() + ", size=" + getEncodeSize() + ", applicationProperties=" + applicationProperties + ", properties=" + properties + ", extraProperties = " + getExtraProperties() + "]"; }
@Override public void reloadPersistence(ActiveMQBuffer record) { int size = record.readInt(); byte[] recordArray = new byte[size]; record.readBytes(recordArray); data = ReadableBuffer.ByteBufferReader.wrap(ByteBuffer.wrap(recordArray)); // Message state is now that the underlying buffer is loaded but the contents // not yet scanned, once done the message is fully populated and ready for dispatch. // Force a scan now and tidy the state variables to reflect where we are following // this reload from the store. scanMessageData(); messageDataScanned = true; modified = false; // Message state should reflect that is came from persistent storage which // can happen when moved to a durable location. We must re-encode here to // avoid a subsequent redelivery from suddenly appearing with a durable header // tag when the initial delivery did not. if (!isDurable()) { setDurable(true); reencode(); } }
@Override public String toString() { return "AMQPMessage [durable=" + isDurable() + ", messageID=" + getMessageID() + ", address=" + getAddress() + ", size=" + getEncodeSize() + ", applicationProperties=" + getApplicationProperties() + ", properties=" + getProperties() + ", extraProperties = " + getExtraProperties() + "]"; }
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 org.apache.activemq.artemis.api.core.Message copy() { checkBuffer(); ReadableBuffer view = data.duplicate(); byte[] newData = new byte[view.remaining() - (messagePaylodStart - headerEnds)]; view.position(0).limit(headerEnds); view.get(newData, 0, headerEnds); view.clear(); view.position(messagePaylodStart); view.get(newData, headerEnds, view.remaining()); AMQPMessage newEncode = new AMQPMessage(this.messageFormat, newData, extraProperties, coreMessageObjectPools); newEncode.setDurable(isDurable()).setMessageID(this.getMessageID()); return newEncode; }
result.getInnerMessage().setDurable(message.isDurable()); result.getInnerMessage().setPriority(message.getPriority()); result.getInnerMessage().setAddress(message.getAddressSimpleString());
result.getInnerMessage().setDurable(message.isDurable()); result.getInnerMessage().setPriority(message.getPriority()); result.getInnerMessage().setAddress(message.getAddressSimpleString());