Jun 14th, 2012, 04:28 AM
Best approach for handling Client -> HTTP request -> Async XML Message Based Service
I'm relatively new to using the Spring Framework. I'm familiar with DI, AOP and using Spring MVC to build my server but I have the following scenario and wondered if there is anything in Spring that can help. The scenario is (pretty common I'm sure):
- Operator clicks button in GUI;
- Client application requests new XML data from MyServer via HTTP;
- MyServer receives request;
- MyServer constructs custom XML message to request data;
- MyServer writes XML to file;
- ExternalSystem reads XML file and places into message queue;
- ExternalSystem processes request and creates XML response message;
- ExternalSystem writes response XML to file;
- MyServer reads response XML and extracts data;
- MyServer returns HTTP response containing data;
- Client displays data to Operator;
I'm using Spring MVC to implement MyServer etc but I'm not sure on the best approach for handling the asynchronous behaviour of the ExternalSystem within the scope of the client HTTP request. Blocking the thread within MyServer until the ExternalSystem has completed the request just seems wrong. Please note the client isn't a web browser and the Operator can't do much while waiting for the data.
Any ideas / suggestions welcome.