File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/main/java/com/rabbitmq/stream Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,29 @@ public interface Message {
8686 */
8787 Map <String , Object > getMessageAnnotations ();
8888
89+ /**
90+ * Add a message annotation to the message.
91+ *
92+ * @param key the message annotation key
93+ * @param value the message annotation value
94+ * @return the modified message
95+ * @since 0.12.0
96+ */
8997 default Message annotate (String key , Object value ) {
9098 this .getMessageAnnotations ().put (key , value );
9199 return this ;
92100 }
93101
102+ /**
103+ * Create a copy of the message.
104+ *
105+ * <p>The message copy contains the exact same instances of the original bare message (body,
106+ * properties, application properties), only the message annotations are actually copied and can
107+ * be modified independently.
108+ *
109+ * @return the message copy
110+ * @since 0.12.0
111+ */
94112 default Message copy () {
95113 return this ;
96114 }
You can’t perform that action at this time.
0 commit comments