cc @tonysurma @MisterJames @dpaquette @stevejgordon
Right now, for the CSV import, we're invoking the IGeocoder once per Request. The problem/concern here is since we're not limiting how many requests we process in a CSV import:
- we could exceed the amount of requests supported in a given time frame to Google Maps (which is what
IGeocoder is calling behind the scenes). Since IGeocoder does not have an "batch" API, we might need to see if there is a max request per time period allowed, and then throttle to calls to the API to not exceed that threshold
- b/c we're combining a transactional resource (the db) with a non-transactional resource (web service call via IGeocoder) in the same logical transaction (
ImportRequestsCommandHandler.Handle), we could end up with the user waiting for the success message to come back to them, or in a worst case scenario, get a timeout caused by the web service.
After talking to @MisterJames and @dpaquette about it, we want to avoid using Hangfire for this (which was my initial approach) b/c this does not represent a scheduled operation, but purely, as async operation. Since azure storage/queues combined with webjobs can do the same thing, and it does not utilize web server resources like Hangfire, we want to use azure for this type of operation.
The high level items that would need to be accomplished for this to happen is outlined in Issue #1626. Once this code/webjob is in place and working, we can update the code in ImportRequestsCommandHandler to send a message on the azure queue for lat/long lookup
cc @tonysurma @MisterJames @dpaquette @stevejgordon
Right now, for the CSV import, we're invoking the IGeocoder once per Request. The problem/concern here is since we're not limiting how many requests we process in a CSV import:
IGeocoderis calling behind the scenes). Since IGeocoder does not have an "batch" API, we might need to see if there is a max request per time period allowed, and then throttle to calls to the API to not exceed that thresholdImportRequestsCommandHandler.Handle), we could end up with the user waiting for the success message to come back to them, or in a worst case scenario, get a timeout caused by the web service.After talking to @MisterJames and @dpaquette about it, we want to avoid using Hangfire for this (which was my initial approach) b/c this does not represent a scheduled operation, but purely, as async operation. Since azure storage/queues combined with webjobs can do the same thing, and it does not utilize web server resources like Hangfire, we want to use azure for this type of operation.
The high level items that would need to be accomplished for this to happen is outlined in Issue #1626. Once this code/webjob is in place and working, we can update the code in
ImportRequestsCommandHandlerto send a message on the azure queue for lat/long lookup