If you want to get some information from your Indigo/DFE, you can always send it a JMF. But if you are actively monitoring the status of the device, you're better off with a JMF subscription which will notify an HTTP endpoint when something changes. Below you'll find an example on how to implement a basic JMF subscription endpoint using Node.
Requirements
- Node
- NPM
Clone the GitHub repo (https://github.com/dominickp/JMF-Subscription).
"cd" to the repository directory and run the following to install the needed node modules:
Code: Select all
npm install winston
npm install xml2js
npm install request
Configuration
Edit "JmfSubscriptionInitalize.js" and set the "idp_endpoint" variable to be the URI for your JMF device (this could be the press or DFE). Then, set the "jmf_subscription_server" to be the HTTP endpoint the JMF device should update with the subscription (should be something like 'your_local_ip:9090'). You can get a little fancier with the JMF you send to the device. In my example, I just have a basic "QueryStatus" JMF being sent from a string.
Usage
"cd" to the repository directory and run the following command:
Code: Select all
node JmfSubscriptionInitalize.js

Now that you have set your subscription, we need to launch our "jmf_subscription_server" to capture the messages as they are sent. Run the following command:
Code: Select all
node JmfSubscriptionServer.js
Now wait a bit and you'll start to see some updates in the JmfSubscriptionServer.js window:

Thanks to winston, the responses are also logged in a log file in "logs/":
