Publisher Endpoint

The next section of the sample_appsettings.json file defines information about the target, including its name, data format, protocol, and security settings.

Note: Properties are listed in the order they appear in the sample_appsettings.json file. Use the search to find a particular property.

Property Description Required Property: Value Example

name

The root object that contains the name of the endpoint, specified in endpointConnections.

yes

"name": "MySparkPlug",

role

The function performed by the endpoint. Possible values include:

  • Source — Where the data to be published is collected from CygNet
  • Target — Where the collected data is published to the MQTT server

The publisher endpoint role must be set to "Target" and the CygNet service endpoints' role must be set to "Source".

yes

"role": "Target",

dataFormat

Defines the data format of the source or target data. Contains required and optional members.

yes

"dataFormat": {

"type": "Sparkplug",

"version": "1.0b",

"compression": "None",

"topics": {

"groupId": "Pad123",

"gatewayNodeId": "Link0001"

}

},

type

Specifies the dataFormat type. Possible values include:

  • Sparkplug
  • AWS (for Amazon Web Services IoT Core)

See version and compression for additional options for the Sparkplug dataFormat type.

See Publishing Data for information about publishing data using the Sparkplug and AWS data format types.

yes

See dataFormat.

version

The version number (1.0b) of the Sparkplug protocol. Should not be changed. Only required when type is "Sparkplug".

yes

See dataFormat.

compression

When set to a value other than "none", Link compresses the data using the specified format, then packages the compressed data into the body of the payload, appending information to describe the content (see Payload Compression for more information). Possible values include:

  • none — Payload is not compressed
  • zlib — Payload is compressed using the zlib (RFC 1950) compression format
  • gzip — Payload is compressed using the gzip (RFC 1952) compression format

Only required when type is "Sparkplug".

no

See dataFormat.

topics

Contains the topics (groupId and gatewayNodeId) sent by the publisher to the server for message filtering and routing. The server then determines which subscribers will receive the message.

topics should only be used for endpoints having a role value of "Target."

See Topic and Payloads for more information.

yes

See dataFormat.

groupId

Provides for a logical grouping of data from the publisher into the server and back out to the subscribing clients.

yes

See dataFormat.

gatewayNodeId

Uniquely identifies the topic within the infrastructure. The groupId combined with the gatewayNodeId must be unique from any other groupId /gatewayNodeId defined.

yes

See dataFormat.

protocol

Contains protocol address information properties.

yes

"protocol": {

"type": "MQTT",

"hostname": "10.97.19.106",

"port": 1883,

"keepAlive": 60,

"maxQueuedMessages": 5000,

"clientId": "MyClientId",

"vendor": {

"name": ""

}

"security": {

.

.

.

}

},

type

Specifies the protocol type.

yes

See protocol.

hostname

The host name of the endpoint. Possible values include:

  • If the type is "MQTT", the name or IP address of the server
  • If the type is "CygNet", the appropriate Site.Service

Since this hostname is in the publisher endpoint, the value is the name or IP address of the MQTT server.

yes

See protocol.

port

The port number for the source or target host. Possible values include:

  • If the type is "MQTT", this refers to the port on the MQTT server.
  • If the type is "CygNet", this refers to the domain of the CygNet Site.Service.

Since this port is in the publisher endpoint, the value is the port on the MQTT server.

yes

See protocol.

keepAlive

Specifies the longest period of time that a connection between the server and client can remain open without sending a message. If no message is received in one and a half times the interval listed, the connection is closed.

no

See protocol.

maxQueuedMessages

When connection to the server is interrupted, published messages are held in a queue until the connection is restored. When the messages in the queue reach the maxQueuedMessages value, the queue discards the oldest message when a new message is published. If messages are in the queue when the Link service is terminated, the messages are saved and returned to the queue when the service is restarted.

The default minimum value is 5000. If a value lower than 5000 is entered, it automatically resets to 5000.

no

See protocol.

clientId

This property is used by MQTT clients to identify the client to the server. A client ID must only contain alphanumeric characters, with a maximum of 65535 characters. If the client ID is unspecified or blank, the MQTT client will auto-generate a unique ID.

Link has no restriction on the MQTT character set used. Note that some brokers might reject client IDs that use characters beyond the MQTT specification.

no

See protocol.

vendor

Contains server vendor information. Vendor is not included in the sample_appsettings.json file but is a valid object.

no

See protocol.

name

The name of the server vendor. Possible value:

  • Amazon — Must be used if the endpoint type is "AWS", or the endpoint will not function properly

no

"vendor": {

"name": "Amazon"

}

security

Contains security settings for the publisher endpoint.

no

"security": {

"encryption": {

"protocol": "",

"trustedCertificatePath": "",

"clientKeystore": {

"path": "",

"password": ""

},

"ignoreCertificateRevocationErrors": true

},

"credentials": {

"user": "",

"password": ""

}

}

},

encryption

Allows the user to establish an encrypted connection with the server. While not required, the server may reject a connection if encryption is required and the member settings are not provided.

no

See security.

protocol

The protocol version to use if the server allows/requires an encrypted connection. Choose the version based on what the server supports. Possible values include:

  • TLS 1.0
  • TLS 1.1
  • TLS 1.2

no

See security.

trustedCertificatePath

Indicates the TLS/SSL certificate required by the server. This can be used for servers that allow or require an encrypted connection.

no

See security.

clientKeyStore

If mutual SSL/TLS authentication is required, the settings in this object can be used to provide the necessary client information to the server. Includes path and password/encryptedPassword members.

no

See security.

path

Specifies a path to the keystore containing the client certificate and private key in PKCS12 format (usually a .p12 or .pfx file). If required, use the OpenSSL tool to generate a .pfx file from the certificate and private key.

no

See security.

password or encryptedPassword

The password or encrypted password for the PKCS12-formatted keystore. If the keystore is not password-protected, this property can be removed or left blank.

See Link Security for more information about password encryption. If unencrypted this member will be "password" and the value will be visible. If encrypted, this member will be "encryptedPassword" and the value will be obfuscated.

no

See security.

ignoreCertificateRevocationErrors

Allows the user to ignore errors from the certification revocation server.

no

See security.

credentials

The settings in this object allow the configuration of member credentials if the server requires user authentication. While not required, the server may reject a connection if credentials are required and the member settings are not provided. Includes user and password/encryptedPassword members.

no

See security.

user

The username to connect to the MQTT server.

no

See security.

password or encryptedPassword

The password or encrypted password to connect to the MQTT server.

See Link Security for more information about password encryption. If unencrypted this member will be "password" and the value will be visible. If encrypted, this member will be "encryptedPassword" and the value will be obfuscated.

no

See security.