Best Practices for Your Subscriptions and Topics
This topic covers best practices related to subscriptions and topics .
Maintain a Positive Email Sender Reputation
When creating an email subscription, follow Deliverability Best Practices to maintain a positive email sender reputation. This practice can help you avoid being added to suppression lists.
Set Up Custom Domains for Email
When creating an email subscription that uses a custom domain, ensure that a custom return path for that domain is set up. Custom return paths are created using the Email Delivery service.
Prevent Processing of Duplicate Items
As depicted at Flow of Message Publication, an event, alarm , or direct publication can trigger a message . The Notifications service then sends the message to many types of subscriptions, including email, HTTPS endpoints, and functions.
Depending on your goals, you may want to prevent your system from processing duplicate messages from a given message trigger. This situation is especially relevant when messages are sent to function subscriptions, which can result in double invocations. (For an example of a function subscription, see Scenario A: Automatically Resize VMs.)
To prevent your system from processing duplicate messages, write code that de-duplicates received messages by using identifiers specific to the trigger:
- For any message, consider using a custom de-dupe key entered in the body of the message.
- For alarm-triggered messages, use a combination of
dedupekey
andtimestampEpochMillis
from the alarm message. - For event-triggered messages, use
eventID
from the event message. - For directly published messages, use
X-OCI-NS-MessageId
in the header (provided by Notifications). See Standard header metadata.
For handling duplicate requests sent to Oracle Cloud Infrastructure API endpoints, see Retry Token.
For related troubleshooting information, see Troubleshooting Notifications.