Submitting and retrieving reports #110
Replies: 9 comments
|
Could you request the reports, lodge the report ID in a database, then just poll every minute to see if reports that are not completed are ready, download and mark as complete in the db? I've only done some basic work with the reports API so this would be my go to solution to begin with. |
|
Thanks Bob. That's close to where I started from. I have been working on a new project moving data to Mysql tables & the client has 12 reports to gather. I am adding this here in case it helps someone else. In the process, I found that polling for the id's in the list of finished reports won't end well... I didn't know this before yesterday, but after submitting a report, Amazon will cancel it if the data hasn't been updated since your last request. At least I am assuming that's the reason they cancel it. Also, some reports may not have data to return. This causes big problems when you expect 12 reports and only get 1 or 2. Here is my code for submitting the reports: What I have done to get around the problem is request submitted report list from This will work as a log file of the submitted reports. This way the client won't be calling me twice a week asking me to check on report 'xyz' because it's not in the database. Next, I will need to write code to poll the database and download the reports with a 'DONE' status and save them to the correct table. |
|
Hi, the amazon MWS documentation recommends using the push notifications service instead of polling. I believe we can use the Subscriptions API for the same. It seems to me that this feature was implemented, although I cannot find it in the code. Would @Bobspadger be able to tell us where it is? I would be happy to document it once I'm able to try it. |
|
Looks like they do support Feeds and Reports in notifications http://docs.developer.amazonservices.com/en_UK/subscriptions/Subscriptions_NotificationType.html The subscriptions part of this project is in the develop branch here: https://github.com/python-amazon-mws/python-amazon-mws/blob/develop/mws/apis/subscriptions.py |
|
That's quite a bit of effort! Thank you! I'll try it out. |
|
for the subscriptions you will need to install and configure boto to receive the messages. I find a Redis db for this is fantastic. |
|
i have redis configured in my application - is both still required? can i set redis as the queue system instead? |
|
@Mitalee sadly the queue system has to be amazon SQS ( their docs are helpful on this) I use Redis because of the Key/Value aspect, I lodge the Redis works superbly for this :) |

Uh oh!
There was an error while loading. Please reload this page.
I have implemented several programs that download different reports.
Here is my process so far...
This is not a problem until I have several reports and they don't all come back with data, essentially blocking the process. The only way I have found around this is to check for the latest report first, then submit the report for the next iteration.
Another idea I have thought of is to skip the submission step by scheduling the report, but not every report can be scheduled, so it ends up being a partial solution.
How do you guys handle report submissions? Am I missing something?
All reactions