Click here to Skip to main content
15,913,027 members

Comments by yong2579 (Top 2 by date)

yong2579 6-Aug-14 21:16pm View    
Hmm pardon me but for summary point 1, if I were to implement a possible solution, do you mean something like:

Original Scenario:

At [WebApp], invoke [Assembly1]InvoiceHelper.Post
At [Assembly1], invoke [WCF]new InvoiceServiceClient().Post
At [WCF], invoke [Assembly1]InvoiceMgr.PostLocal

Possible Solution:

At [WebApp], invoke [Assembly1]InvoiceHelper.Post
At [Assembly1], invoke [Assembly2]RemoteHelper.Post
At [Assembly2], invoke [WCF]new InvoiceServiceClient().Post
At [WCF], invoke [Assembly1]InvoiceMgr.PostLocal
yong2579 6-Aug-14 0:27am View    
Hello Kieth, sincerely appreciate your time to help out here and massive thanks for your proposed solution. In a nutshell I understand these are what you are proposing:

1) Rather than helper to call manager that contains data access codes, have helper to call manager which in turn call data access objects (DAO) within DAL to make changes to the database.

2) Rather than posting immediately, setup some queue mechanism so that another thread which poll this queue and do the posting by itself.

3) Rather than posting one by one, batch up invoices and do a single post (E.g. InvoiceMgr.PostForeign(invoices);)

Hmm I do have some comments for each of the points:

1) Actually within InvoiceMgr.Post, it's calling a 3rd party integration API to process the provided invoice. Through profiling, I know this API is making lots of retrieval and some insertion/updating of data for each post operation. (E.g. IntegratorAPI.Post(invoice);)

2) The queue strategy looks feasible but this will impact the system on how invoices are posted. Example, a new invoice status "Pending Post" needs to be introduced and invoice having this status needs to have certain controls disabled while it's waiting to be posted.
The bad news is the web application is not within our control as it is done by another vendor. They hire us to build this posting mechanism via InvoiceHelper.Post
I think while it looks good, the additional cost to change the web application may not be too acceptable by them.

3) For posting by batch, it's doesn't quite solve the situation as a single invoice already take 2-3 minutes via the API.

Hmm I think I'm still kind of stuck in the situation, do you have another advices? Thanks!