{"id":"774a6fa2-58a6-48b8-a739-438e6b99b606","task":"Subscribe to commercetools Change Messages via a subscription to track order state transitions in an event-driven microservice","domain":"commercetools.com","steps":["Create a Subscription resource in commercetools targeting an external message destination such as AWS SQS, Google Cloud Pub/Sub, or an Azure Service Bus queue; provide the destination credentials in the subscription definition","Configure the messages array in the subscription to include the OrderStateChanged message type so the subscription only delivers relevant events rather than all change messages","In the consuming microservice, process messages from the queue; each message contains the resourceId, the old state, and the new state along with metadata such as the store key and project key","Implement idempotency in the consumer using the message sequenceNumber or a unique message ID to detect and skip already-processed messages that may be redelivered","Handle the case where a message is delivered but the downstream action fails; use the queue's visibility timeout or acknowledgment mechanism to allow reprocessing without losing the message","Monitor the subscription's health via the commercetools API by checking the subscription status field; a failing destination will cause the subscription to enter an unhealthy state"],"gotchas":["commercetools messages are delivered at least once; duplicate delivery is possible during queue outages or network retries, so idempotent processing is mandatory","The subscription destination credentials are stored encrypted in commercetools but are sent as part of message delivery; rotate destination credentials regularly and update the subscription definition accordingly","Not all resource changes generate Change Messages; some update actions do not produce a corresponding message type, requiring a reconciliation polling job as a fallback for completeness"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:48.523Z"},"url":"https://mcp.waymark.network/r/774a6fa2-58a6-48b8-a739-438e6b99b606"}