LM-Charles / LMShipService

1 stars 0 forks source link

GET courier/rate/ for difference city request always time out (longer than 15s) #76

Open rufuszhu opened 8 years ago

rufuszhu commented 8 years ago

Sample request {"client":2,"fromAddress":{"address":"7362 Elmbridge Way","address2":"","city":"Richmond","province":"BC","country":"CA","postal":"V6X 0A6"},"toAddress":{"address":"1234 Fairfield Avenue","address2":"","city":"Winnipeg","province":"MB","country":"CA","postal":"R3T 2R2"},"shipments":[{"height":"0","width":"0","length":"0","shipmentPackageType":"LARGE","weight":"5","goodCategoryType":"REGULAR"}],"declareValue":"100","insuranceValue":"100","appointmentDate":1459062000,"appointmentSlotType":"SLOT_1"}

desmond-zhou commented 8 years ago

Irregardless of the input, Fedex is having lag spike, current call timeout is set to 30 second so that is the maximum latency. I have added more concurrency and changed timeout to 15, which make the system more responsive but increase the likelihood that some carrier's quote are not returned.

The carrier API performance is out of our control, and retry and timeout need to balance accuracy and waiting time.

desmond-zhou commented 8 years ago

https://github.com/LM-Charles/LMShipService/commit/8ebb467403b19688a2b37ee63ef92e982727a55a https://github.com/LM-Charles/LMShipService/commit/543bde350c357b89815e5f0c556a47e972251227

desmond-zhou commented 8 years ago

Cannot fix directly, need to work around

desmond-zhou commented 8 years ago

Gonna get the latest rocket ship it library to see if they have any thing that help

desmond-zhou commented 8 years ago

looks quite promising to do this update.

desmond-zhou commented 8 years ago

Deploying an update, if this helps then we are set, overwise we still need that work around.

desmond-zhou commented 8 years ago

Seems like the update actually fixed this issue.