Skip to content

Commit

Permalink
Merge pull request #686 from telefonicaid/fix/default_transport
Browse files Browse the repository at this point in the history
fix default transport
  • Loading branch information
fgalan authored Jan 20, 2025
2 parents 31eff42 + 962be77 commit 3c6bba5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix: use config.defaultTransport (from config.js or IOTA_DEFAULT_TRANSPORT env var) instead of magic 'HTTP' at provision device
- Add: X-Processing-Time response header with processing time (in milliseconds) expended by current HTTP measure (iotagent-node-lib#1650)
9 changes: 5 additions & 4 deletions docs/usermanual.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ Robot1@turn|left

##### Time processing

HTTP bindig is returning in a HTTP header named `X-Processing-Time` processing time (in milliseconds) expended by current HTTP measure
request. For example:
HTTP bindig is returning in a HTTP header named `X-Processing-Time` processing time (in milliseconds) expended by
current HTTP measure request. For example:

```
X-Processing-Time: 38
```
Expand Down Expand Up @@ -378,8 +379,8 @@ commands and a topic to receive configuration information. This mechanism can be
configuration flag, `configRetrieval`.

In case of MQTT to retrieve configuration parameters from the Context Broker, it is required that the device should be
provisioned using "MQTT" as transport key, at device or group level. By default it will be considered "HTTP" as
transport.
provisioned using "MQTT" as transport key, at device or group level. By default it will be considered "MQTT" as
transport if none transport is defined at device or group level or IOTA_DEFAULT_TRANSPORT env var.

The parameter will be given as follows:

Expand Down
2 changes: 1 addition & 1 deletion lib/bindings/HTTPBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function setPollingAndDefaultTransport(device, group, callback) {
context = fillService(context, device);
config.getLogger().debug(context, 'httpbinding.setPollingAndDefaultTransport device %j group %j', device, group);
if (!device.transport) {
device.transport = group && group.transport ? group.transport : 'HTTP';
device.transport = group && group.transport ? group.transport : config.getConfig().defaultTransport;
}

if (device.transport === 'HTTP') {
Expand Down

0 comments on commit 3c6bba5

Please sign in to comment.