Best Practices for Subscriptions and Topics
Review best practices for subscriptions and topics used with Oracle Cloud Infrastructure Notifications.
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. For more information about suppression lists, see Managing the Suppression List.
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
An alarm, announcement subscription, event rule, connector, or contextual notification (alarm or event rule) 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 might want to prevent your system from processing duplicate messages from a given message trigger. This situation is especially relevant when sending messages to function subscriptions, which can result in double invocations. (For an example of a function subscription, see Scenario A: Automatically Resizing 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.