Calling an application from a web server asynchronously

可紊 提交于 2019-12-06 07:58:28

You have two options.

  1. Start a separate JVM instance by doing a exec and using a java command.

  2. Spawn a new thread - this will use server's resources though.

You can also combine options 1 and 2 and create a thread that does the exec call.

Yes, from the web server register RMI callback with the standalone java application.

When the web application requests the standalone APP it would be synchronous call and would not take long time. Once when the standalone app is ready with the results it would invoke the web app using the RMI callback.

In your Java Application, create a thread and execute the code on it. The Java Application will return the call to the web server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!