on 04-19-2018 8:34 AM
Hi,
Need suggestion on how to update UI on data change in oracle DB without refresh/reload or polling , need the data to be pushed automatically to UI.
Thanks,
Wasim
I would recommend websockets for that
MQTT, Socket.io or something like that.
It is highly googleble 😉
https://blogs.sap.com/2013/02/04/websockets-with-nodejs-socketio-and-abap-part-2-node-server-app/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nicholas,
Thanks for you response.
Let me explain my scenario in more detail:
We are using SAP PO server and not SAP Cloud. We have a UI built in SAP ui5 and all DB operations are done using REST services built using JAVA session bean.
Now our requirement is to trigger a message to UI when ever there is a change in DB entry (also we can use Java System property instead of DB).
I know there is an api to capture the event triggered when a value is changed in Java System property. I need to make a call to UI through this event capturing Java service.
Is there a way to do this.Or there is other way possible which I am not able to look at.
Your response will be really helpful.
Thanks,
Wasim
Hello.
So to trigger the message to the UI you will need a middle layer. This middle layer can be a websocket to update the UI.
Client connects to websocket middleware.
When New insert into DB => SAP PO POST to middleware => Middleware Pushes data to client via Websocket => Client triggers a function when receiving data.
This will give you a live update. No refresh, reload or POST to REST service to check for updates, it will tell the client when it is a update and you can push data thru the websocket. Its a data stream if i am not mistaking.
Or check out MQTT, works the same way. I just like socket.io better for some reason.
https://blogs.sap.com/2016/04/21/advantco-mqtt-adapter-fro-sap-pipo/
Hi Nicholas,
So let me state what i understood.
I have create a Java Webservice to update the DB, in the same Java Service do I need to call the Websocket to push data to UI?
Also I am working on SAP PO server with Java 7.40, does it allow websocket, as in one of the blog I read that it does not.
Thanks,
Wasim
Yes, you need to push a message to a microservice/middleware that is running a Websocket, or MQTT (Java suport) http://mqtt.org/tag/java. With one of those two you can run a function live in the frontend. And pas data to the front end. So you can add a new row to a table without a refresh in the frontend or a new cal to the backend.
I am a javascript dude my self, so i would create a microservice with NodeJS and Socet.io. And it is hard for me to explain this better.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.