How to provide a synchronous EJB method that wraps an asynchronous CORBA service?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Davide_Baroncelli
Posted On:   Wednesday, April 24, 2002 05:47 AM

I need to develop a web service (well, a simple servlet interface, actually) that calls an EJB providing a billing function. The problem is the EJB uses a back end CORBA system (following the OSA Parlay standard) to execute the actual billing, and this last system uses an asynchronous call model which involves callbacks for returning answers: so I have to provide a synchronous function through HTTP, but using an asynchronous back end. How can this be done using EJB? It seems to me that providing the billing function resolving the asynchronous part inside the EJB is impossible. My idea is: the servlet receiving the HTTP request should first call the ejb in order for it to forward the request to the corba back end; the EJB should pass t   More>>


I need to develop a web service (well, a simple servlet interface, actually) that calls an EJB providing a billing function. The problem is the EJB uses a back end CORBA system (following the OSA Parlay standard) to execute the actual billing, and this last system uses an asynchronous call model which involves callbacks for returning answers: so I have to provide a synchronous function through HTTP, but using an asynchronous back end. How can this be done using EJB?



It seems to me that providing the billing function resolving the asynchronous part inside the EJB is impossible. My idea is: the servlet receiving the HTTP request should first call the ejb in order for it to forward the request to the corba back end; the EJB should pass the corba back end some callback object which should implement the callback method with the sending of a message in a JMS queue. After calling the corba object the EJB should return, and the calling servlet should wait for that message on the EJB queue. The asynchronous function called by the CORBA object on the java callback should cause the message to be sent on the queue and the servlet to be awakened, allowing it to send an answer to the client in the HTTP response.



Is this reasonable? Is there any way to provide a single method of the EJB that offers a synchronous interface to the calling servlet, without forcing it to manage this two-step process?

   <<Less

Re: How to provide a synchronous EJB method that wraps an asynchronous CORBA service?

Posted By:   Christopher_Schultz  
Posted On:   Wednesday, April 24, 2002 07:59 AM

I think this two step-process is necessary, but you get to decide who performs the two steps.



You could optionally have the client call the servlet which dispatches this billing request, and then continually hit another servlet which reports on the progress of that request. Is that viable?



-chris
About | Sitemap | Contact