Available since versions: 2.0.2-fireball(onesait Platform) & 2.0.2-RELEASE(client library).
The following use of the library is intended to be used by administrators/developers of the platform willing to provide (micro)services that use this library to connect to the Digital Broker in Multitenant mode.
The client library Client4SpringBoot can be used in Multitenant mode. To use it in such way, you have to take into account the following considerations.
Application properties/yaml
To use this library in Multitenant mode, you have to add the following properties to the application properties:
onesaitplatform: iotclient: multitenant: true admin-api-token: 8e303d50cfd647ce97c9b18f3031d908 deviceTemplate: MasterDevice #token: 902409548c704c33befefddbed0ef66f
The admin-api-token, is the application user token of a vertical administrator, that you can find at /controlpanel/apimanager/token/list:
Device token is no longer needed in this mode, as the library will take care of token management for the device.
Annotations
All IoT Broker annotations including: @IoTBrokerDelete, @IoTBrokerInsert, @IoTBrokerQuery, @IoTBrokerUpdate, and @IoTBrokerTransaction; now have an extra argument ‘tenant’ that you must specify. This way the library and the Broker will know how to manage the requests.
This argument is specified with SpEL (Spring expression language), as it will be dynamic at runtime. Here are some examples of use:
0 Comments