Skip to content

Commit

Permalink
Merge branch 'master' into fix/check_endpoint_exp
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan authored Jan 20, 2025
2 parents 9cbeac8 + e5f0442 commit 3f689a4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- Fix: check endpoint expression when execute http command
- 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)
- Add: print also IOTA_CONFIG_RETRIEVAL, IOTA_DEFAULT_KEY, IOTA_DEFAULT_TRANSPORT env var values at iotagent startup
4 changes: 2 additions & 2 deletions docs/usermanual.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,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 if none transport is defined at device or group level.
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/HTTPBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ function handleError(error, req, res, next) {
function setPollingAndDefaultTransport(device, group, callback) {
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
9 changes: 6 additions & 3 deletions lib/configService.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ function processEnvironmentVariables() {
'IOTA_HTTP_PORT',
'IOTA_HTTP_TIMEOUT',
'IOTA_HTTP_KEY',
'IOTA_HTTP_CERT'
'IOTA_HTTP_CERT',
'IOTA_CONFIG_RETRIEVAL',
'IOTA_DEFAULT_KEY',
'IOTA_DEFAULT_TRANSPORT'
];
const mqttVariables = [
'IOTA_MQTT_PROTOCOL',
Expand Down Expand Up @@ -229,7 +232,7 @@ function processEnvironmentVariables() {
config.mqtt.clientId = process.env.IOTA_MQTT_CLIENT_ID;
}

if (process.env.IOTA_MQTT_DISABLED && process.env.IOTA_MQTT_DISABLED.trim().toLowerCase() === 'true'){
if (process.env.IOTA_MQTT_DISABLED && process.env.IOTA_MQTT_DISABLED.trim().toLowerCase() === 'true') {
config.mqtt.disabled = true;
}

Expand Down Expand Up @@ -274,7 +277,7 @@ function processEnvironmentVariables() {
config.amqp.retryTime = process.env.IOTA_AMQP_RETRY_TIME;
}

if (process.env.IOTA_AMQP_DISABLED && process.env.IOTA_AMQP_DISABLED.trim().toLowerCase() === 'true'){
if (process.env.IOTA_AMQP_DISABLED && process.env.IOTA_AMQP_DISABLED.trim().toLowerCase() === 'true') {
config.amqp.disabled = true;
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ config.iota = {
};

config.defaultKey = '1234';
config.defaultTransport = 'MQTT';
config.defaultTransport = 'HTTP';

module.exports = config;

0 comments on commit 3f689a4

Please sign in to comment.