To implement a custom transport, you need to complete the following steps.
- Design and compile a configuration schema.
- Implement the TransportConfig interface.
- Implement Transport.
- Provision the transport in a Bootstrap server and/or an Operations server.
Please note that once a new transport is implemented, you will most likely need to implement a corresponding transport channel for one or multiple endpoint SDK platforms.
Transport configuration schema
A transport configuration schema is an Avro compatible schema that defines configuration parameters for the transport. The following parameters in the schema affect Kaa Admin UI layout.
- minRowCount - specifies a minimum number of rows in a UI table (If you are using arrays in your schema, you can specify a minimum number of elements in an array with this parameter)
- displayName - displays the name of the field on UI
- displayNames - displays the name of each enumeration symbol on UI (only for enumeration fields in the schema)
- default - displays the default value of the field on UI
- optional - defines whether the field on UI is optional or mandatory
- weight - defines a relative width of the corresponding column on UI (only for arrays in the schema)
The following example illustrates a simple transport configuration schema with two fields (host and port).
Once you have prepared your schema, you can compile it using the following command.
java -jar /path/to/avro-tools-1.7.7.jar compile schema <schema file> <destination>
For more information, refer to Compiling the schema. It is also possible to integrate the schema compilation with avro-maven-plugin.
Transport descriptor implementation
Once you have defined and compiled a transport configuration schema, you can proceed to the implementation of a transport descriptor.
Note: all transport descriptors should be inside the
org.kaaproject.kaa.server.transport package or its subpackages
The following example illustrates a transport descriptor implementation based on the schema defined in the previous section.
The following example illustrates a transport implementation based on the defined transport configuration schema.
To provision the implemented transport, you need to put all the transport related classes into the classpath of the server. Also, you need to make sure that the transport configuration file is present in the classpath and its schema and name match appropriate parameters from your transport descriptor.
The following example illustrates the configuration file contents that match our transport. This file should be named
Note: you can use transport configuration variables from the
bootstrap-server.properties files; these variables must have the