1

I have already done a project using jsp as backend, while the business logic in backend is implemented by java. Now I want to rewrite this project.I hope the part of backend communicating with browser is implemented with nodejs and the business logic in backend still use java to implement.Now I met with a problem about how to communicate between nodejs and java in backend. Is there any feasible solution? Thanks

2 Answers 2

3

Node.js is a standalone runtime environment (based on V8, which is implemented in C++). Since it is not based on Java technology it has no "simple" way to communicate with Java code running in a JVM.

Integrating unrelated technologies, such as these two, is typically done by using some sort of inter-process communication, for example, TCP sockets or a message queue with bindings native to each platform (e.g. zeromq). Creating a JNI interface is another possible option.

Searching the web for keywords such as "node.js java bridge" yields a number of interesting results.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank for your reply.It's really helpful to me.I will try these methods.I also find a related topic link.There are also some ideas I hope will be of value to you.Thank you so much!
0

I think u can check this

https://www.npmjs.com/package/java

Using this you can call method of java from node.js

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.