I had before a project where i need to push data(websocket) to the client i used spring and atmosphere framework(an abstract of websocket in java). But finally i think actually websocket app in java are not enough good since i used nodejs&socket.io for an another project. It was so easy and a great experience to code an push data api.
So now i am thinking about an architecture and i want to share with you to know if its a good practices.
I have my server spring, client and nodejs/socket.io. I want to use nodejs just to store de socket and push event.
So imagine the server has to push data to specific users i will call a service in nodejs and he will push it.
So the nodejs API will just redirect requests to a user, nothing more.
Is that a good practice ?
Thanks for your idea
I would advice you decouple java application server and nodejs (socket server) and communicate using a middleware (messaging system..)
Let's say your java application is running on http://abc.com:1234 and socket.io on http://abc.com:5678. Then when the page is opened you can subscribe of the socket server.
Once you have some data to push, put it on middleware. SocketIO server will pick it up from there and pushes to all the browser client subscribed.
Related
I would like to implement a server-side push notification service for iOS.
When the application goes to the Background I need to send notifications to the client for different events and if it's necessary to wake app the application.
Currently in my system I have Apache tomcat Server and what I'm interested in to have a kind of tutorial of how that could be implemented. Is it possible to use for instance web-sockets, or what kind of alternatives such as TCP sockets from JAVA?
I have found some stand alone services such as AirNotifier, and EasyAPNs but I would prefer not make complex my configuration by including more programming languages.
Thanks
I'm developing a Desktop LAN base java server and client application
where a Client must login and also to pass some data to server.
assuming i have 10 clients that inserting record simultaneously to server.
which is the best approach in this kind of situation, should I use RMI for login and record insertion? or Sockets?
if sockets please provide a key idea for me to start with.
key points to consider
-Multithreading
-able to send back data on client
If you want to connect your server via internet (and/or firewalls) it is probably a hassle to do this with plain RMI. In the past I have used Java Simon for such tasks which is very easy to implement. However if you plan to support other clients than Java clients, then you should have a look at Apache Thrift or Google Protocoll Buffers
I have a little question about an android app with a function "remote" use via internet.
So I have these ideas:
Create a webservice using php on the server, and refresh the client app all x time like 4-5 sec
Or make a java server (so I don't know how I can do that)
I just want make a remote connected via user/password to the server and the other app connect to the server and refresh his status.
Do you know the best way for do that?
Thanks
The question is not very precise, but as far as I understand it, both your ideas implement the 'pull' concept, that is the client app checking the status of the server every now and then.
If you want the app to be instantly notified of the server status change, I would suggest push notifications with GCM (Google Clound Messaging). You can find some basic descriptions and examples at: http://developer.android.com/google/gcm/index.html
Sending a server-to-client notification is simple regardless of the platform you use server side. E.g. for PHP integration with GCM, check out this thread: GCM with PHP (Google Cloud Messaging)
I am developing system, that consists of client (written in JavaFX) and server. Now I am going to implement server. Users will download clients. Clients will communicate with server (only one server and many clients). Server will communicate with data base and send results. Server will support authentication and different requests (not http of course). Is it a good idea to implement server with Java RMI? If no, could you advice me any good idea about server realisation.
Thanks a lot for future questions!
RMI is bit kind of traditional but still powerful to me ,it has some draw back . But, despite the RMI there is also a chance for you to use java sockets class ? just like a client -server application ...
I'm working on a server client base "Desktop Application". And what I want to do is this,
Client application sending some request code to server through internet(oh yes, these connections must be secured). and when server application gets this code it will again do some work and gather some data.
And then server application will return those data again to the client application.
As I am new in this, I need to know, what kind of tools to use?
Is eclipse good for that?
Where can I find good examples for writing client?
Where can I find examples for connecting client with server side?
I'd recomend checking out apache httpclient it really helps when dealing with web APIs.