Java based web application using Node.js? - java

I am a novice to web application programming trying to build first webapp and read that Node.js can be used for high-performance, highly concurrent and suited for web applications.
My question is that is it possible to hook up Node.js with Java backend?
How does that work?
Thanks

To start off with node.js is a backend. So if you have a misconception of what node.js then you don't need Java.
If you want to integrated node.js into an existing Java application to use it as a real time communication platform then you can get the two talking to each other over TCP sockets.
Take a look at the net docs

Related

Can Electron apps be integrated with java code?

As node.js still lacks important functionality which exists in Java, I would like to use Java instead of node.js, and create the client using a web language (html, js, css..).
Electron is cross platform and so does java so it seems fit to have a solution getting the best of both worlds.
Does someone know of a way to integrate electron with java or have a different solution to the problem?
I made something similar, Java back-end with Electron GUI.
You can do it in more ways, it depends on what you need.
You can create a jar file and then execute it like terminal:
https://nodejs.org/api/child_process.html
Or you can open a socket communication and talk on a Port. (A lot of documentation:
Java (web)socket - Node.js client.io)
In this second way, you can do everything you want, but you have to create your communication protocol.
Your path is not foolish, I am very satisfied of the communication and usage in my work with Java + Electron .
I've created a small PoC where Java process is integrated with Electron front-end: https://github.com/jreznot/electron-java-app There you will find a simple TODO List application built with Vaadin/Jetty and Electron.
Personally i made my back-end java communicate with the front-end by creating a file with te data then sending it to the main.js to be processed.
DBus and winDbus seems to be an option here.
It creates nice abstraction and separation between "frontend" and backend
https://sourceforge.net/projects/windbus/
I'm going to test it on my own soon

How to call ruby from java in cloud foundry?

I have a requirement where i need to call/trigger the ruby ETL program from java code in the cloud foundry environment. will cloudfoundry supports 2 different buildpacks to run on single application instance. Is it possible to run java and ruby processes on the single instance in cloud foundry. I'm new to cloud foundry any help is greatly appreciated.
A simple way to have programs written in different programming languages communicate with each other is using REST. Also if asynchronous communication is preferred, you may want to exchange messages via a message broker (e.g. RabbitMQ).
I would recommend deploying two different apps (one written in Ruby and the other written in Java) and have the ruby app expose a REST endpoint that can be triggered by your java app. You could secure this endpoint using some authentication mechanism (e.g. HTTP Basic).
The possibility of running 2 different buildpacks with a single application does, to the best of my knowlege, not exist. Also this does not seem to be a clean approach in my eyes.

Java Desktop app and Java EE?

Is it possible for a Java desktop application to interact with Java Servlets or Java EE Applications?
Yes it is definitely possible, take a look at Web Services. Here is another link with a simpler explanation.
You can also use EJBs (stateful or stateless). Installing an EJB client on your desktop app will take care of most of the communication details for you. And you always have the option of communicating via pure RMI. Both options would typically be more efficient than a SOAP or REST based solution. Good options if you don't need to worry about creating a non-java version of your desktop app.

Creating Apps In Google Web Toolkit, Hosting Options?

So i have been looking into GWT and it does look pretty interesting as i do have experience in programming in java and being able to create webapps does look very interesting to me.
I have looked at some of the basic tutorials and have got GWT working in my eclipse environment. Now, If i was to begin creating webapps with it how would i go about uploading and hosting my app. I have only used PHP and MySQL for web development so i would always just use Apache, I am not to sure about GWT hosting. Does it require the app to be hosted on googles App Engine platform or can I setup a server like to usually do when using Apache?
Thanks.
Using GWT does not require you to host your app on App Engine. You can host a GWT app on any host.
If you want your server to be written in Java, to take advantage of some of the more useful features of GWT, you will obviously need to find a host that allows you to run Java. But you can write a GWT app that communicates with a PHP server, or a Python server, or anything else.
If you're familiar with PHP + MySQL it's not a bad idea to stick to that and just add your compiled GWT output as another component that you upload. Switching to App Engine requires a fundamental change in the way you write and design your application which means you'll be learning new front-end and back-end technologies at the same time. Just as an example, a simple full-text search on one field is pretty trivial for a small php + mysql app but because App Engine forces you to write extremely scalable code it's not trivial on GAE.

intranet chat application using java

Any help would be great please..!
How to build an intranet chat application using java which includes transform of files like gtalk?
where to start the process?
what all the sw requirements?
The Eclipse Communication Framework includes several use cases based upon real-time shared editing over XMPP/Google Talk and Skype
And ECF is the base for a twitter client (as an example of what you can do with that framework)
you must have learned networking in java (java.net.*)
be sure of what king d of architecture you want to use
client/server
p2p
xmpp
If you need to deploy one, you can use Jabber with one of many Java Clients out there.
If you need to write your own server and/or client, you can start with this question and use an existing XMPP (IM protocol) libraries.
Why build one when good open source solutions based on open standards are available.
Take a look at running an Openfire XMPP (Jabber) server.
Theres a variety of clients available the best being:
Spark
Pidgin
I beleive that a flash client is also available.

Categories

Resources