Skip to content

Commit

Permalink
ARTEMIS-4470 prevent the common trap
Browse files Browse the repository at this point in the history
Omitting reencode() results in latent error that surfaces only in
AMQP-AMQP messaging.
  • Loading branch information
pekuz authored and jbertram committed Nov 8, 2023
1 parent 0fc1906 commit ebb747b
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ default Message setValidatedUserID(String validatedUserID) {

void reloadPersistence(ActiveMQBuffer record, CoreMessageObjectPools pools);

/** Propagate message modifications to clients. */
default void reencode() {
// only valid probably on AMQP
}
Expand Down Expand Up @@ -520,54 +521,75 @@ default Object getDuplicateProperty() {
return null;
}

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putBooleanProperty(String key, boolean value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putByteProperty(String key, byte value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putBytesProperty(String key, byte[] value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putShortProperty(String key, short value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putCharProperty(String key, char value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putIntProperty(String key, int value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putLongProperty(String key, long value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putFloatProperty(String key, float value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putDoubleProperty(String key, double value);



/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putBooleanProperty(SimpleString key, boolean value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putByteProperty(SimpleString key, byte value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putBytesProperty(SimpleString key, byte[] value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putShortProperty(SimpleString key, short value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putCharProperty(SimpleString key, char value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putIntProperty(SimpleString key, int value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putLongProperty(SimpleString key, long value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putFloatProperty(SimpleString key, float value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putDoubleProperty(SimpleString key, double value);

/**
* Puts a String property in this message.
* <p>
* Callers must call {@link #reencode()} in order to be sent to clients
*
* @param key property name
* @param value property value
*/
Message putStringProperty(String key, String value);

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException;

/** Callers must call {@link #reencode()} in order to be sent to clients */
Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException;

Object removeProperty(String key);
Expand Down

0 comments on commit ebb747b

Please sign in to comment.