Developing a module to read data from Redis in-memory data structure store
-
hi dear supporter
I need to developing a module of Mango Automation 2.7 to read data from Redis, a in-memory data structure store, used as database, cache and message broker.
I think the new data source should be like the SQL data source to a certain extend, could you give some instruction for me on how to develop such a data source?
Thanks.
-
you just want to read data from Redis,or you want store and read on redis;if you want store,you need to solve the key-Unique issue,redis is key-value struct,if you just want to read,it 's simple,you can see the redis official demo.
-
hi Hussam
I need only to read data from redis and know how to program that. Now I need some instruction on how to build such a data source module on MangoAutomation 2.7.
Could you please give some advice? Or any open source code can be refered.
Thanks.
-
Hi Medbius,
You could consider the SSH data source for this purpose. It provides functionality to SSH into a server using a key, run a command and use regex to parse the result.
If you consider it necessary to write your own data source, you'll have to pick an API to query which could determine which module would be a good launching point. If you're using the CLI, any module for a polling data source (such as ASCII file) could get you the general structure, and you'll be invoking commands in the runtime within the doPoll method, which you could look at ProcessHandlerRT for some example usage. Then most of the work would be in writing the wrappers to make it usable.
-
Hi phildunlap,
We really appreciate your kind help. With your help, we made the new module work. But we still met a problem as the data points in watchlist(http://localhost:8080/watch_list.shtm) do not refresh periodically. In the new module, we have removed some data like "timestampFormat".
Could you please tell us what could possibly make this refreshing not work?
Thanks
Mebius
-
Hi mebius,
Two possibilities come to mind, either...
- the session viewing the watchlist has expired. If this were the case, refreshing the page would either correct it or present a login page.
- the method you're using to save point values isn't the DataPointRT.updatePointValue method. This method generates events, while going directly through the PointValueCache may not.
-
I used wrong API as case-2. It works fine now. Thank you very much!