birdy
birdy

Reputation: 9636

Grails App with java service and JMS

I'm starting out with Grails and want to build a sample application.

Below is the flow of the application I'm envisioning. I'll follow up with questions.

The flow of the app:

Questions

I would really appreciate any articles/tutorials on an example of a simple app like the one above...?

Upvotes: 0

Views: 428

Answers (1)

Marco
Marco

Reputation: 15929

In you case JMS is used in a synchonous way, so it depends on your JMS provider if you can do this. If the JMS provider is able of doing synchronous communication you put the answer after the file processsing into a reply queue.

In the synchronous JMS way, the java service will wait for a response from the JMS provider so can can present the response from the service back to the controller and then to the user...

So..:

  • User uploads a file
  • controller gets the file and just sends a it to the JMS queue and waits for response!
  • Java service running separately fetches the file from the queue and processes it (just reads the first word)
  • Java service puts the response back in a reply queue
  • Controller wil get the response reads the response and present it to the user

Your page could be a nice ajax page that presents the user with a processing spinner.

Upvotes: 1

Related Questions