Amazon-MWS: Difference between Reports and Order lists - java

I'm trying to integrate the orders from Amazon Marketplace into our system. I did that before with Magento and thought this should be easy as that, but somehow I got stuck.
I downloaded the Java APIs from Amazon and started playing around with the examples.
So far so good - I was able to get them running.
But playing with the Reports API and the Orders API, I started to wonder which one to use if I only want to get the unshipped orders to put them into our system.
1. doing this with the Report API seems very complicated and involves a lot of calls to the MWS. This is documented by Amazon here.
2. using the Orders API seems pretty straightforward. I only have to create a ListOrdersRequest, define what type of orders I want to have and finally get them via a ListOrders call.
So my question is: What is the reason to choose the Reports API over the Orders API?
Seems like Amazon is recommending the Reports API, but I really do not understand why this should be so complicated. Why should I get Reports when I can get the Orders directly?

Both approaches can work. Here's why I would pick the Reports API:
Reports are more scalable. I believe MWS reports can return an unlimited number of records. ListOrders can only return a maximum of 100 orders. You can get more using ListOrdersByNextToken, but that brings throttling into the problem and it is not clear whether or not you're just paging by an offset (which could cause lost/duplicate orders) or whether it is a snapshot.
You can acknowledge reports and filter on unacknowledged reports. Orders can be acknowledged too, but I don't think there is a way of filtering ListOrders based on acknowledgement status.
Reports can be scheduled to auto-generate on an interval, as often as every 15 minutes. This means that it may not be as many calls as you think: really, it's only three every interval: one to list unacknowledged order reports, one to pull the report you want and one to acknowledge it.

Related

Polling multiple twitter accounts for tweet impression and likes

I'm currently working on a use case (developed in Java,Spring) where I've large no. of twitter accounts (no. of accounts can go to thousand) to which I can post data(tweet) as when configured/scheduled.
I've implemented posting of data to twitter but I'm confused how to pull impressions/retweets and likes of tweets from various twitter accounts.
One solution is to poll all accounts on regular interval, but in that case I won't be getting no of likes on tweet made, because I'm using user and mentions timeline APIs with "since_id" parameter, which do not return no of likes on my older tweets as it always fetches latest tweet and retweet.
Another option is to use streaming APIs, in which I will be opening a stream for every twitter account I have but that doesn't seems feasible to me because I have very large no. of twitter accounts with me and I doubt that my Java app can handle that many no. of streams.
Can someone please suggest how can I solve this, any help is greatly appreciated.
IT seems your problem is due to scale rather then the design ,the statement "and I doubt that my Java app can handle that many no. of streams."
let's look in a different direction.
It's time to move to the world of "Big Data".
Apache kafa,Pig,Hive,Yarn,Strom,HBase,Hadoop etc.list is overwhelming.
Apache Spark- large-scale data processing that and supports concepts such as MapReduce, in-memory processing, stream processing, graph processing etc.
Storm was created by Twitter the counter part you can say is Apache storm.
Apache Kafka it offers brokers that collect streams, log and buffer them in a fault tolerant manner.
Hadoop for storage of the data.
http://www.itworld.com/article/2827285/big-data/what-hadoop-can--and-can-t-do.html
happy designing.

Java non-event monitoring

I work for a company that has a java based eCommerce site. We have a new initiative to monitor when things aren't happening when they should be, such as guests not signing in and lack of completed orders. For example, we expect x amount of orders at y time of day and when they are below the standard deviation we want to know about this through an alerting system. We are already monitoring (the solutions we use are below) the health of the application and have a pulse on exceptions being thrown. We are looking to catch when the app appears to be in good working order, but events we expect to be triggered aren't happening. For example - our credit card authorizer could start declining all of the credit authorizing attempts so no orders are coming through, etc.
We are capable of building this ourselves, probably with Drools, but would prefer to find an out of the box solution. In our research we have not found anything that really fits what we are looking for and didn't find the functionality in we are already using. If any of the monitoring solutions we already use are capable of delivering this functionality that would be the route we would prefer.
dynaTrace
Truesite
Hyperic
Coremetrics analytics
Thank you for your help and time!
If you already have dynatrace then go with it. It can do all of what you are looking for. It can monitor your Credit Card Service and alert you in case reponse time goes down or in case it throws errors. It goes much broader than that use case - it actually tells you which end users are affected - whether this is just for certain types of users (from a certain region, from a certain type of device, ...) or if it is for everyone.
If you have questions on how to use dynatrace for your use cases I suggest you put a question on the dynatrace community forum - they are pretty active over there: https://community.compuwareapm.com/community/display/DTFORUM/dynaTrace+Forums+Home
You can also watch some of the video tutorials on youtube to make yourself more familiar with its capabilities: http://bit.ly/dttutorials

Evolution of an application, data treatment, and synchronization

I m actually an android developper in a little society in France. I ve never been faced to this problem before now.
Explanation :
We have developped an android application which has to work with and without network connection (impliying synchronization ascending and descending)
The user has to connect himself, then we request the WebService to access the informations he needs to make his treatments. But, he needs to get ~2500 lines (marshalled by JackSon in our objects). This synchronization takes nearly 3 mns in 3g and more than 5 mns in Edge... and then make what he had to do, and sent the information back to the server when he get a network connection.
MySQL and our webservices give information in good time ( ~0.05s/requests for mysql, and ~105ms/request accessing the webservice from a webpage). We actually need 10-15 requests to get all the needed informations.
Is there any way to reduce, or a solution to improve / refactor our coding methods.
In fact, I guess we didnt think the application by the good side, when I look Google drive mobile or messenger Facebook app which are really really fast x__x' .
So I m looking for a solution, and moreover, we have a client that needs to get ~50 000 lines per users in the next few monthes...
Thanks for all,

Queuing requests to have just a single user "working"

Basically I'm trying to build a Java WebApp that will interface an Arduino. Due to this "phisical" limitation I will have just one user at the time working with the microcontroller.
I would like to create a queue with all the requests and set a limit (i.e. 20 seconds) and then go with the next user. There will be probably in the future the option to have two users connected to "interact" each other.
How can I implement this infrastructure? JMS? Other ways?
I've used other mqs as Kestrel but just with "strings", and I've no clue on how to use it in my case. : /
(I will probably use JBoss if this is relevant, or helpful)
Thanks in advance!
There is an RXTX Java library that comes with Arduno and I would suggest to use that for Arduno interface.

Aggregating results from various sources - Java application architecture

I searched in google and stackoverflow for my problem, but couldn't find a good solution. Below is the description,
Our Java web application displays search results from our local database and external webservice API calls. So, the search logic should combine these results and display it in the result page. The problem is, the external API calls return the results slower than our local DB calls. Performance is crucial for our search results and the results should be live i.e. we should not cache or persist the external results in our local DB. Right now, we are spanning two threads, one for the DB call and another one for the exteral API, and combine these results and display it on the screen. But it kills the performance of our application, particularly when we call more than one external APIs.
Is there any architectural solution for this problem?
Any help would be greatly appreciated.
Thanks.
You cannot display data before you have it.
1) You can display your local data and as they come, add via ajax other data.
2) And if there are repeated questions, you could cache external answers for short time (and display them with warning that they are old and that they will be replaced by fresh answer) and as soon as fresh anwer arrive, push new answer.
With at least 1), system will be responsive, with 2) usable answer can be available imediately, even if its not current.
btw, if external source take long to answer, are you sure that their answer is not stale (eg. if they gather some data and wait for rest, then what they gathered so far can go stale)? So maybe (and maybe not) short term persisting is not as bad as you think.

Categories