@Override public int getEncodeSize(Message record) { int encodeSize = super.getEncodeSize(record) + DataConstants.SIZE_INT; TypedProperties properties = ((AMQPMessage)record).getExtraProperties(); return encodeSize + (properties != null ? properties.getEncodeSize() : 0); }
@Override public int getEncodeSize(Message record) { int encodeSize = super.getEncodeSize(record) + DataConstants.SIZE_INT; TypedProperties properties = ((AMQPMessage)record).getExtraProperties(); return encodeSize + (properties != null ? properties.getEncodeSize() : 0); }
@Override public String toString() { return "AMQPMessage [durable=" + isDurable() + ", messageID=" + getMessageID() + ", address=" + getAddress() + ", size=" + getEncodeSize() + ", applicationProperties=" + applicationProperties + ", properties=" + properties + ", extraProperties = " + getExtraProperties() + "]"; }
@Override public SimpleString getAddressSimpleString() { if (address == null) { TypedProperties extraProperties = getExtraProperties(); // we first check if extraProperties is not null, no need to create it just to check it here if (extraProperties != null) { address = extraProperties.getSimpleStringProperty(ADDRESS_PROPERTY); } if (address == null) { // if it still null, it will look for the address on the getTo(); if (properties != null && properties.getTo() != null) { address = cachedAddressSimpleString(properties.getTo()); } } } return address; }
/** Sub classes must add the first short as the protocol-id */ @Override public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); TypedProperties properties = ((AMQPMessage)record).getExtraProperties(); if (properties == null) { buffer.writeInt(0); } else { buffer.writeInt(properties.getEncodeSize()); properties.encode(buffer.byteBuf()); } }
@Override public SimpleString getAddressSimpleString() { if (address == null) { TypedProperties extraProperties = getExtraProperties(); // we first check if extraProperties is not null, no need to create it just to check it here if (extraProperties != null) { address = extraProperties.getSimpleStringProperty(ADDRESS_PROPERTY); } if (address == null) { // if it still null, it will look for the address on the getTo(); Properties properties = getProperties(); if (properties != null && properties.getTo() != null) { address = cachedAddressSimpleString(properties.getTo()); } } } return address; }
/** Sub classes must add the first short as the protocol-id */ @Override public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); TypedProperties properties = ((AMQPMessage)record).getExtraProperties(); if (properties == null) { buffer.writeInt(0); } else { buffer.writeInt(properties.getEncodeSize()); properties.encode(buffer.byteBuf()); } }
@Override public String toString() { return "AMQPMessage [durable=" + isDurable() + ", messageID=" + getMessageID() + ", address=" + getAddress() + ", size=" + getEncodeSize() + ", applicationProperties=" + getApplicationProperties() + ", properties=" + getProperties() + ", extraProperties = " + getExtraProperties() + "]"; }
processProperties(result, properties); processFooter(result, footer); processExtraProperties(result, message.getExtraProperties());
processExtraProperties(result, message.getExtraProperties());