开发者

Grails background call vie camle or background-thread

I need to improve the response time for a Grails application, so I need to use concurrent processing to separate work that can be done after the users web page is refreshed

It seems like the Camel and background-thread plugins can do this for me. I tried the Camel way, but get 'Session does not exists' errors, which 开发者_运维技巧looks like hibernate can not operate in an Camel acynchonouse call.

In the background-thread description they mention that they solved this problem.

Can any one tell me which which will be the better choice and which ones plays nicely with Hibernate?

All the best Ulrich


Try the Quartz plugin. The recently released v0.4.2 fixes the "Session does not exist" error that was affecting a few plugins due to a change in Grails 1.2. Quartz is great for doing scheduled background work and also one-off jobs.

http://grails.org/plugin/quartz


The Background-thread plugin works for me in Grails 1.2.1 I have not tried the Camel Route.

The only issue I faced was while changing code at Development time (I think it was a Domain Class), however once I restarted the application it worked and has ever since.

Hope that helps.


Camel is intended for integration between systems, and is not a perfect fit in your scenario. If Quartz is not a fit for you (as Burt suggested), I would suggest that you look at JMS - it will allow you to fire async messages into a queue for processing. If you use the JMS plugin, you can configure a service to respond to incoming messages, and GORM/etc. will work as expected. You will however need to run a JMS server to support this architecture, which could be run on the same machine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜