cancel
Showing results for 
Search instead for 
Did you mean: 

Why Asynchronous service?

Former Member
0 Kudos

Hi,

Can anyone explain to me, as to why we go for creating an

asynchronous service & when?

What are the basic advantages of asynchronous services?

I would like to know how any asycnhronous service would look like?

And also would like to know how to create an asycnhronous service?

Kindly let me know.

Best Regards,

Nalini

Accepted Solutions (1)

Accepted Solutions (1)

gajendra_bhakuni
Active Participant
0 Kudos

Hi Nalini,

We go for asynchronous service when the caller does not need to wait for the sender to finish the action. The caller of the service just call the asynchronous service and continues with the current operation. This is similar to the normal tRFC call of a function module. In case of synchronous service the caller need to wait for the called service to be finished and the results to be returned. Typical eg. would be the check ATP synchronous service which is called during asynchronous sales order create. Only when the ATP check is successful the sales order is saved.

An asynchronous service will have only input parameters. It will not have return or output parameters (as in the case of a synchronous service). An asynchronous service can trigger exceptions.

Some ways to develop service in ABAP : - /people/thomas.jung3/blog/2004/11/15/bsp-150-a-developer146s-journal-part-xiii-developing-abap-webservices

/people/thomas.jung3/blog/2005/01/05/develop-a-web-service-that-sends-an-email--in-abap

/people/thomas.jung3/blog/2005/05/09/abap-webservices-logon-language-processing

I hope this helps.

Regards,

Gajendra.

Message was edited by:

Gajendra Bhakuni

Former Member
0 Kudos

Hi Gajendra,

I clear got ur point about why we go for asynchronous service:)

The examples sited in the blog are very good and self explanatory.

Thanks a lot:-)

So,as per my understanding, we will have an asynchronous service with only import parameters and not export parameters.

Ok, having understood the advantages, I would now like to know how reliable is the data being sent?

Service consumer(SC) sends the request to the service provider(SP), but he would not know if the service has been successfully reached the SP.

In that case, how do we handle the situation?

An acknowledgement should be sent saying that the request has been reached.

That comes to a point that we would have an exporting parameter?

Or can we handle all these with the exceptions itself?

Kindly let me know!

Thanks and kind regards,

Nalini

gajendra_bhakuni
Active Participant
0 Kudos

Hi Nalini,

I would say it depends upon the business or the scenario under which u want to make have ur service as asynchronous or synchronous.

Lets take one eg. say we have a scenario wherein invoice request are sent from the supplier to the customer. This is a typical B2B case. Now the request are successfully sent from the SC but fails at the receiving side. In this scenario the

receiver is responsible for triggering the recovery. Exceptions are triggered as a result of failure at the SP side. This can trigger a alert. The administrator can look at the alert monitor and can do the action accordingly (he can sent the message back to the SC informing him that the message failed).

There can be many patterns or communication b/w SP and SC.

Read the following articles to get more insights:

1) http://www.ibm.com/developerworks/library/ws-asynch1.html - Part 1

2) http://www.ibm.com/developerworks/library/ws-asynch2/index.html - Part 2

I hope this helps.

Regards,

Gajendra.

Former Member
0 Kudos

Thanks a lot:-) It was very very helpful!

Best Regards,

Nalini

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nalini,

"To improve performance of Web service methods that invoke long-running methods that block their thread, you should consider exposing them as asynchronous Web service methods. Implementing an asynchronous Web service method allows that thread to execute other code when it is returned to the thread pool. This allows one more of the limited number of threads in the thread pool to execute, enhancing the overall performance and scalability of the system."

The above description is as stated by Microsoft.

Please let the community know in which language you like to develop the service,so that you can get support through a code sample.

Thanks,

Akella.

Former Member
0 Kudos

Hi Akella,

Thanks for such an useful answer:)

Infact, there is one more question popping up about asynchronous service!

I understand that the basic advantages are performance and scalability.

But, does it not harm the reliability of the data sent?

How do we know that the data has been sent to the service provider successfully?

Because, we do not get any answer from the service provider or probably it takes

loads and loads of time for that?

In that case, how do we know that the data has been sent or not?