amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
585 stars 730 forks source link

[BUG] [SP-API] Receiving all automatically generated reports always 10 TIMES at once using Notifications API and SQS Queue #2616

Closed luap2703 closed 1 year ago

luap2703 commented 1 year ago

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

SP-API Name and Version or Report/Feed Type

Expected Behavior

We connected the SP API Notifications via a SQS queue to receive notifications when reports are finished/errored. We now experience that we receive 10 TIMES the same message for the reports e.g., "GET_XML_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL" or "GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA" when being finished. All of these notifications have the same reportId, so the report gets somehow pushed 10 TIMES into the queue?!

This must obviously a bug, as we can technically only assign a single subscription for receiving reports and the messages are appearing directly in the queue.

Current Behavior

Please see the following SQS AWS except and also our logging.

Bildschirmfoto 2023-06-18 um 19 16 07 Bildschirmfoto 2023-06-18 um 19 16 37
owsiakl commented 1 year ago

Hey @paulo2703, we had a similar problem - in our case it was duplicating the message for each requested marketplace.

Our best guess is because how MWS API was working before - you could create notification subscription for a single marketplace, but since SP-API is handling the whole region, you are "automatically" subscribed to all marketplaces in that region which causes sending multiple notifications.

For a short term solution, you can deduplicate those messages using notification id as a deduplication key.

rodrifed commented 1 year ago

Hi @paulo2703 and @owsiakl,

Thank you for reporting this issue, and providing a workaround.

We have taken a note of it, and will prioritize a solution accordingly. Once a change is applied, you can expect an announcement in our public documentation website: https://developer-docs.amazon.com/sp-api.

Thank you, Federico Selling Partner Developer Services