0

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:

  • User uploads a file
  • controller gets the file and just sends a response back saying "uploaded"
  • File is put in a JMS queue
  • Java service running separately fetches the file from the queue and processes it (just reads the first word)
  • Java service puts the response back (where does it put the response?)
  • Grails App will read the response and present it to the user

Questions

  • Where does the java service put the data after reading the file?
  • How does the grails app read the data put by the java sevice?
  • Is there something missing from my understanding? I plan to use grails jms plugin and ActiveMQ
  • Can something be improved in this architecture? This is a prototype I'm putting together for a bigger application.

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

1 Answer 1

1

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.

2
  • 1
    Have written a system very similar to this, and Grails webapps talking to a seperate Spring-based backend processing system via sync JMS (use JmsInvokerProxyFactoryBean) is a way you could go.
    – shuttsy
    Dec 21, 2012 at 11:00
  • What is the meaning of (just reads the first word) in Java service running separately fetches the file from the queue and processes it (just reads the first word)
    – user4903583
    Jun 18, 2015 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.