Question
· Jul 31, 2017

Streaming data from Cache

Hi everyone,

I am trying to build an application based on real-time streaming data. A back-end program is continually writing to the Cache database, and then the data from the Cache database is retrieved through a REST API by a front-end program. The REST API is static -- it just gives the front-end all the data in the database at the time it was called. The problem is that every time the Cache database is updated, I need to send the newly arrived data to the front-end, but with the static API, there is no way I can, (I can keep sending requests to the REST API, but that would be a waste of resources since the front-end already has most of the data). I am just wondering if there's anyway I can solve this problem.

 

Best,

 

Trung

Discussion (3)0
Log in or sign up to continue

Hi,
without any  REST (at that point)  as you expect to hand action from front-end to back-end:

If your front-end is able to listen on a dedicated IP port  then all you need is to send your data to the (negotiated?) IP:port.
Take a look to %Net.HttpRequest 
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...

From point of view of Caché your front-end acts then like a web-server receiving data.
Your reply from front-end  signals to Caché that the front-end is ready for the next junk / or terminates the stream