UNPKG

node-red-contrib-azure-iothub-service

Version:
83 lines (77 loc) 3.27 kB
<script type="text/javascript"> RED.nodes.registerType('eventhub-recv', { category: 'input', color: '#0080FF', defaults: { name: { value: "" }, connectionstring: { value: "" }, consumergroup: { value: "$default" }, connectionstringType: { value: "cred" }, consumergroupType: { value: "str" }, }, credentials: { connectionstring: { type: "text" }, }, inputs: 0, outputs: 4, outputLabels: ["message", "error", "connect", "close"], icon: "eventhub.png", label: function () { return this.name || "event-hub"; }, oneditprepare: function () { $('#node-input-connectionstring').typedInput({ typeField: "#node-input-connectionstringType", default: this.connectionstringType, types: ['str', 'env', 'cred', 'flow', 'global'], }); $('#node-input-consumergroup').typedInput({ typeField: "#node-input-consumergroupType", default: this.consumergroupType, types: ['str', 'env', 'flow', 'global'], }); }, }); </script> <script type="text/x-red" data-template-name="eventhub-recv"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-connectionstring"><i class="icon-tag"></i> Event Hub Connection String</label> <input type="hidden" id="node-input-connectionstringType"> <input type="text" id="node-input-connectionstring" placeholder="E.g. Endpoint=sb://XXX.servicebus.windows.net/;SharedAccessKeyName=XXX;SharedAccessKey=XXX;EntityPath=XXX"> </div> <div class="form-row"> <label for="node-input-consumergroup"><i class="icon-tag"></i> Event Hub Consumer Group</label> <input type="hidden" id="node-input-consumergroupType"> <input type="text" id="node-input-consumergroup" placeholder="E.g. $default"> </div> </script> <script type="text/x-red" data-help-name="eventhub-recv"> <p>A simple node that receives messages from an Azure Event Hub...</p> <h3>Inputs</h3> <dl class="message-properties"> There are no inputs. </dl> <h3>Outputs</h3> <ol class="node-ports"> <li>Standard output <dl class="message-properties"> <dt>payload <span class="property-type">object</span></dt> <dd>A JSON object, received from the Event Hub.</dd> </dl> </li> </ol> <h3>Details</h3> In the node's properties, the connection string of the Event Hub to which you would like to connect, can be specified. Additionally the Consumer Group can be set in the properties as well. Both values can be retreived from the Azure Portal. <h3>References</h3> <ul> <li><a href="https://azure.microsoft.com/en-us/services/event-hubs/">Azure Event Hubs</a></li> <li><a href="https://github.com/azure/azure-event-hubs-node">Azure Event Hubs NodeJS client (in preview)</a> - the client library used by this node</li> </ul> </script>