Indigo JMF Subscriptions - An Example

gabrielp

Member
I posted this over at the Enfocus forums and figured it might be helpful to share here.

Overview
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

Installation
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:
npm install winston
npm install xml2js
npm install request
You should then see a folder in your repo called "node_modules/". In the repo directory, create an additional folder called "logs/".

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:
node JmfSubscriptionInitalize.js
If it worked correctly, you should see a big XML (JMF) response:
kYJWbmN.png


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:
node JmfSubscriptionServer.js
You'll see an immediate response that the server is listening to the specified port. In my example: "Server listening on: http://localhost:9090".

Now wait a bit and you'll start to see some updates in the JmfSubscriptionServer.js window:
37AKAeN.png


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

PressWise

A 30-day Fix for Managed Chaos

As any print professional knows, printing can be managed chaos. Software that solves multiple problems and provides measurable and monetizable value has a direct impact on the bottom-line.

“We reduced order entry costs by about 40%.” Significant savings in a shop that turns about 500 jobs a month.


Learn how…….

   
Back
Top