You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/cross_service/topics_and_queues/README.md
+23-22Lines changed: 23 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,22 +19,22 @@ The sample code builds a command line application that asks you for input. This
19
19
### Create an SNS topic
20
20
21
21
```
22
-
Would you like to work with FIFO topics? (y/n)
22
+
Would you like to work with FIFO topics? (y/n):
23
23
```
24
24
25
25
You configure FIFO (First-In-First-Out) topics when you create them. Choosing a FIFO topic enables other options, too. To learn more, see [FIFO topics example use case](https://docs.aws.amazon.com/sns/latest/dg/fifo-example-use-case.html).
26
26
27
27
28
28
```
29
-
Use content-based deduplication instead of a deduplication ID? (y/n)
29
+
Use content-based deduplication instead of entering a deduplication ID? (y/n):
30
30
```
31
31
32
32
Deduplication is only available for FIFO topics. Deduplication prevents the subscriber from responding more than once to events that are determined to be duplicates. If a message gets published to an SNS FIFO topic and it’s found to be a duplicate within the five-minute deduplication interval, the message is accepted but not delivered. For more information, see [Message deduplication for FIFO topics](https://docs.aws.amazon.com/sns/latest/dg/fifo-message-dedup.html).
33
33
34
34
Content-based deduplication uses a hash of the content as a deduplication ID. If content-based deduplication is not enabled, you must include a deduplication ID with each message.
35
35
36
36
```
37
-
Enter a name for your SNS topic:
37
+
Enter a name for your SNS topic:
38
38
```
39
39
40
40
Topic names can have 1-256 characters. They can contain uppercase and lowercase ASCII letters, numbers, underscores, and hyphens. If you chose a FIFO topic, the application automatically adds a “.fifo” suffix, which is required for FIFO topics.
@@ -45,27 +45,27 @@ Now, configure two SQS queues to subscribe to your topic. Separate queues for ea
45
45
instance, you can customize how messages are consumed and how messages are filtered.
46
46
47
47
```
48
-
Enter a name for an SQS queue.
48
+
Enter a name for SQS queue #1:
49
49
```
50
50
51
51
Queue names can have 1-80 characters. They can contain uppercase and lowercase ASCII letters, numbers, underscores, and hyphens. If you chose a FIFO topic, the application automatically adds a “.fifo” suffix, which is required for FIFO queues.
52
52
53
53
54
54
```
55
-
Filter messages for "<queue name>.fifo"s subscription to
56
-
the topic "<topic name>.fifo"? (y/n)
55
+
Filter messages for <queue name>'s subscription to the topic? (y/n):
57
56
```
58
57
59
58
If you chose FIFO topics, you can add a filter to the queue’s topic subscription. There are many ways to filter a topic. In this example code, you have the option to filter by a predetermined selection of attributes. For more information about filters, see [Message filtering for FIFO topics](https://docs.aws.amazon.com/sns/latest/dg/fifo-message-filtering.html).
60
59
61
60
62
61
```
63
-
You can filter messages by one or more of the following "tone" attributes.
64
-
1. cheerful
65
-
2. funny
66
-
3. serious
67
-
4. sincere
68
-
Enter a number (or enter zero to stop adding more)
62
+
You can filter messages by one or more of the following TONE attributes.
63
+
Enter a number to add a TONE filter, or enter 0 to stop adding filters.
64
+
1. cheerful
65
+
2. funny
66
+
3. serious
67
+
4. sincere
68
+
Your choice:
69
69
```
70
70
71
71
If you add a filter, you can select one or more “tone” attributes to filter by. When you’re done, enter “0’” to continue.
@@ -79,47 +79,48 @@ After you create the topic and subscribe both queues, the application lets you p
79
79
80
80
81
81
```
82
-
Enter a message text to publish.
82
+
Enter a message to publish:
83
83
```
84
84
85
85
All configurations include a message text.
86
86
87
87
88
88
```
89
-
Enter a message group ID for this message.
89
+
Enter a message group ID for this message:
90
90
```
91
91
92
92
If this is a FIFO topic, then you must include a group ID. The group ID can contain up to 128 alphanumeric characters `(a-z, A-Z, 0-9)` and punctuation `(!"#$%&'()*+,-./:;<=>?@[\]^_``{|}~)`.
93
93
For more information about group IDs, see [Message grouping for FIFO topics](https://docs.aws.amazon.com/sns/latest/dg/fifo-message-grouping.html).
94
94
95
95
96
96
```
97
-
Enter a deduplication ID for this message.
97
+
Enter a deduplication ID for this message:
98
98
```
99
99
100
100
If this is a FIFO topic and content-based deduplication is not enabled, then you must enter a deduplication ID. The message deduplication ID can contain up to 128 alphanumeric characters `(a-z, A-Z, 0-9)` and punctuation `(!"#$%&'()*+,-./:;<=>?@[\]^_``{|}~)`.
101
101
102
102
103
103
```
104
-
Add an attribute to this message? (y/n) y
104
+
Add an attribute to this message? (y/n):
105
105
```
106
106
107
107
If you added a filter to one of the subscriptions, you can choose to add a filtering attribute to the message.
0 commit comments