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
Ably supports idempotent publishing through both REST and Realtime methods. This feature prevents the processing or forwarding duplicate messages when publishing the same message multiple times under certain network conditions or due to client reattempts. Idempotent publishing involves associating each message with a unique ID. The system then uses this ID to prevent further processing of any message published again with the same ID, recognizing it as a duplicate.
756
+
Ably supports idempotent publishing through its REST and realtime interfaces, ensuring that duplicate messages are not processed or forwarded.
757
757
758
-
Ably's SDK automatically add IDs to messages to ensure idempotent handling. This functionality applies to both REST and realtime publishing. For library versions older than 1.2, enabling idempotent REST publishing was not the default and required activation using the @idempotentRestPublishing@ "@ClientOptions@":/api/rest-sdk#client-options. However, starting with version 1.2, its enabled by default.
759
-
You can publish idempotently through Ably's SDK REST and realtime interfaces. Idempotent publishing ensures that duplicate messages published multiple times due to network conditions or client retries are not processed or forwarded again.
758
+
Idempotent publishing automatically assigns each message a unique ID, which prevents further processing if the same message is published again, recognizing it as a duplicate. This is essential for handling retries in poor network conditions.
760
759
761
-
Ably's REST and realtime SDKs automatically add unique IDs to messages. Each message is associated with a unique ID to prevent the processing of duplicates. If a message is published again with the same ID, it is recognized as a duplicate and ignored.
762
-
763
-
In some cases, achieving idempotency requires a client-supplied ID, especially in scenarios where it's impractical to maintain a single continuously active client instance, such as during a publisher restart or when preserving idempotency across an entire message processing pipeline that involves an upstream system using message IDs. In these situations, specifying a custom message ID for REST and realtime publishing maintains idempotency.
764
-
In some cases, achieving idempotency requires specifying a clientId. This is especially important when maintaining a single continuously active client instance is impractical, such as during a publisher restart or when ensuring idempotency across an entire message processing pipeline involving an upstream system using message IDs. Specifying a custom message ID for REST and realtime publishing helps maintain idempotency in these situations.
760
+
In certain instances, idempotent publishing requires a client-supplied ID. This is particularly useful when it is impractical to maintain a single, continuously active client instance, such as during a publisher restart or when maintaining idempotency across an entire message processing pipeline involving an upstream system using message IDs. Specifying a custom message ID for REST and realtime publishing in these scenarios ensures idempotency.
765
761
766
762
<aside data-type='note'>
767
763
<p>From version 1.2, idempotent publishing is enabled by default for both REST and realtime interfaces. In earlier versions, enabling idempotent REST and realtime publishing was not the default and required activation using the @idempotentRestPublishing@ option in "@ClientOptions@.":/api/rest-sdk#client-options</p>
768
764
</aside>
769
765
770
-
The following example manually specifies a message ID:
771
766
The following example manually specifies a message ID:
772
767
773
768
```[realtime_javascript]
774
-
const rest = new Ably.realtime.Promise('{{API_KEY}}');
If manually specifying message IDs, it is important to be aware of how messages are published when calling the "publish()":/api/rest-sdk/channels#publish method with an array of messages. See this "FAQ":https://faqs.ably.com/client-specified-message-id-restrictions-for-multiple-messages-published-atomically for further information.
0 commit comments