What is better in this case - synchronization or asynchronous web service?

I am setting up a web service in Axis2, whose job is to take a bunch of XML and put it in a queue for further processing. I understand that he can configure the client to asynchronously invoke the synchronous web service by creating the invokeNonBlocking operation on the Call instance. (ref http://onjava.com/pub/a/onjava/2005/07/27/axis2.html?page=4 )

So my question is, is there an advantage to using an asynchronous web service in this case? It seems redundant because 1) the client is not blocked and 2) the service should accept and write xml to the queue, regardless of whether it is synchronous or asynchronous

+3
source share
3 answers

In my opinion, asynchronous is a suitable way. A few things to consider:

  • Do you have several customers accessing this service at any time?
  • How often does this process take place?

Implementing asynchronous methods requires a bit more effort. But I guarantee that in the end you will be much happier with the result. Firstly, you do not need to control the flow. The main problem can only be the volatility of the data in the que (i.e. race / deadlock conditions).

+1
source

"Synchronous call" seems appropriate, I agree.

, , . , , , - "" .

, , , .

0

, , . , , . , -, .

0

Source: https://habr.com/ru/post/1729301/


All Articles