Skip to content

Commit cedff4d

Browse files
committed
Document Message#annotate(String,String) and Message#copy()
References #379
1 parent 9930d87 commit cedff4d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/main/java/com/rabbitmq/stream/Message.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)