@@ -42,6 +42,16 @@ class SnsMessage implements Message
42
42
*/
43
43
private $ targetArn ;
44
44
45
+ /**
46
+ * @var string|null
47
+ */
48
+ private $ messageGroupId ;
49
+
50
+ /**
51
+ * @var string|null
52
+ */
53
+ private $ messageDeduplicationId ;
54
+
45
55
/**
46
56
* SnsMessage constructor.
47
57
*
@@ -220,4 +230,48 @@ public function setTargetArn(?string $targetArn): void
220
230
{
221
231
$ this ->targetArn = $ targetArn ;
222
232
}
233
+
234
+ /**
235
+ * Only FIFO.
236
+ *
237
+ * The tag that specifies that a message belongs to a specific message group. Messages that belong to the same
238
+ * message group are processed in a FIFO manner (however, messages in different message groups might be processed
239
+ * out of order).
240
+ * To interleave multiple ordered streams within a single queue, use MessageGroupId values (for example, session
241
+ * data for multiple users). In this scenario, multiple readers can process the queue, but the session data
242
+ * of each user is processed in a FIFO fashion.
243
+ * For more information, see: https://docs.aws.amazon.com/sns/latest/dg/fifo-message-grouping.html
244
+ *
245
+ * @param string|null $id
246
+ */
247
+ public function setMessageGroupId (string $ id = null ): void
248
+ {
249
+ $ this ->messageGroupId = $ id ;
250
+ }
251
+
252
+ /**
253
+ * @return string|null
254
+ */
255
+ public function getMessageGroupId (): ?string
256
+ {
257
+ return $ this ->messageGroupId ;
258
+ }
259
+
260
+ /**
261
+ * Only FIFO.
262
+ *
263
+ * The token used for deduplication of sent messages. If a message with a particular MessageDeduplicationId is
264
+ * sent successfully, any messages sent with the same MessageDeduplicationId are accepted successfully but
265
+ * aren't delivered during the 5-minute deduplication interval.
266
+ * For more information, see https://docs.aws.amazon.com/sns/latest/dg/fifo-message-dedup.html
267
+ */
268
+ public function setMessageDeduplicationId (string $ id = null ): void
269
+ {
270
+ $ this ->messageDeduplicationId = $ id ;
271
+ }
272
+
273
+ public function getMessageDeduplicationId (): ?string
274
+ {
275
+ return $ this ->messageDeduplicationId ;
276
+ }
223
277
}
0 commit comments