diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index ac5b545ba9..6023adfa23 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,5 +1,6 @@ - Add: servicePath field to builtin attributes (#2877) +- Add: notification.mqtt.retain and notification.mqttCustom.retain flag for MQTT retain in notifications (#4388) - Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) - Fix: improve error traces (#4387) - Add: CLI parameter -dbUri / env var ORION_MONGO_URI (#3794) -- Fix: improve logs in MongoDB query logic \ No newline at end of file +- Fix: improve logs in MongoDB query logic diff --git a/doc/manuals.jp/admin/database_model.md b/doc/manuals.jp/admin/database_model.md index 57b8df0d00..52081b2be8 100644 --- a/doc/manuals.jp/admin/database_model.md +++ b/doc/manuals.jp/admin/database_model.md @@ -213,8 +213,9 @@ Orion Context Broker は、データベース内で次のサブセクション - **lastNotification** : 最後の通知が送信された時刻です (整数、秒を意味します)。これは、通知が送信されるたびに更新され、スロットリング違反を回避します - **throttling** : 通知の最小間隔です。0または -1 は、スロットリングがないことを意味します - **reference** : 通知の URL です。HTTPまたはMQTTのいずれかを指定します -- **mqttTopic**: MQTTトピック (MQTT 通知のみ) -- **mqttQoS**: MQTT QoS 値 (MQTT 通知のみ) +- **topic**: MQTTトピック (MQTT 通知のみ) +- **qos**: MQTT QoS 値 (MQTT 通知のみ) +- **retain**: MQTT retain 値 (MQTT 通知のみ) - **entities** : エンティティの配列 (必須) です。各エンティティの JSON には、**id**, **type**, **isPattern** および **isTypePattern** が含まれています。従来の理由から、**isPattern** は `"true"` または `"false"` (テキスト) で、**isTypePattern** は `true` または `false` (ブール値) であることに注意してください - **attrs** : 属性名の配列 (文字列) (オプション) です - **blacklist** : `attrs` をホワイトリスト (もし `blacklist` が `false` また存在しない場合) またはブラックリスト (もし `blackslist` が `true` の場合) として解釈する必要があるかどうかを指定するブール値フィールドです diff --git a/doc/manuals.jp/orion-api.md b/doc/manuals.jp/orion-api.md index a6ce23ffaa..b2687f966b 100644 --- a/doc/manuals.jp/orion-api.md +++ b/doc/manuals.jp/orion-api.md @@ -3760,13 +3760,14 @@ time=... | lvl=WARN | corr=... | trans=... | from=... | srv=... | subsrv=... | c `mqtt` オブジェクトには、次のサブフィールドが含まれています: -| パラメータ | オプション | タイプ | 説明 | -|------------|------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------| -| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | -| `topic` | | string | 使用する MQTT トピックを表します | -| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | -| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | -| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | +| パラメータ | オプション | タイプ | 説明 | +|------------|------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------| +| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | +| `topic` | | string | 使用する MQTT トピックを表します | +| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | +| `retain` | ✓ | boolean | MQTT は、サブスクリプションに関連付けられた通知で使用する値を保持します (`true` または `false`)。 省略した場合は、retain には `false` が使用されます | +| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | +| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | MQTT 通知の詳細については、[MQTT 通知](user/mqtt_notifications.md)のドキュメントを参照してください。 @@ -3797,16 +3798,17 @@ MQTT 通知の詳細については、[MQTT 通知](user/mqtt_notifications.md) `mqttCustom` オブジェクトには、次のサブフィールドが含まれています: -| パラメータ | オプション | タイプ | 説明 | -|------------|------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | -| `topic` | | string | 使用する MQTT トピックを表します。このフィールドに対してもマクロ置換が実行されます (つまり、属性に基づくトピック) | -| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | -| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | -| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | -| `payload` | ✓ | string | 通知で使用されるテキスト・ベースのペイロード。空の文字列または省略された場合、デフォルトのペイロード ([通知メッセージ](#notification-messages)のセクションを参照) が使用されます。`null` の場合、通知にはペイロードは含まれません | -| `json` | ✓ | object | 通知で使用される JSON ベースのペイロード。詳細については、[JSON ペイロード](#json-payloads) セクションを参照してください | -| `ngsi` | ✓ | object | 通知で使用されるペイロードの NGSI パッチ。詳細については、[NGSI ペイロードのパッチ適用](#ngsi-payload-patching) セクションを参照してください | +| パラメータ | オプション | タイプ | 説明 | +|------------|------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | +| `topic` | | string | 使用する MQTT トピックを表します。このフィールドに対してもマクロ置換が実行されます (つまり、属性に基づくトピック) | +| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | +| `retain` | ✓ | boolean | MQTT は、サブスクリプションに関連付けられた通知で使用する値を保持します (`true` または `false`)。 省略した場合は、retain には `false` が使用されます | +| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | +| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | +| `payload` | ✓ | string | 通知で使用されるテキスト・ベースのペイロード。空の文字列または省略された場合、デフォルトのペイロード ([通知メッセージ](#notification-messages)のセクションを参照) が使用されます。`null` の場合、通知にはペイロードは含まれません | +| `json` | ✓ | object | 通知で使用される JSON ベースのペイロード。詳細については、[JSON ペイロード](#json-payloads) セクションを参照してください | +| `ngsi` | ✓ | object | 通知で使用されるペイロードの NGSI パッチ。詳細については、[NGSI ペイロードのパッチ適用](#ngsi-payload-patching) セクションを参照してください | `payload`, `json` または `ngsi` は同時に使用できません。相互に排他的です。 diff --git a/doc/manuals.jp/user/mqtt_notifications.md b/doc/manuals.jp/user/mqtt_notifications.md index c355abd1e3..26d85437af 100644 --- a/doc/manuals.jp/user/mqtt_notifications.md +++ b/doc/manuals.jp/user/mqtt_notifications.md @@ -27,6 +27,7 @@ HTTP 通知とは別に、Orion は MQTT を使用して通知できます。こ * `topic` に、使用する MQTT トピックを指定します * `qos`: サブスクリプションに関連付けられた通知 (0, 1 または 2) で使用する MQTTQoS 値を指定します。 これはオプションのフィールドです。省略した場合、QoS0 が使用されます +* `retain`: サブスクリプションに関連付けられた通知で使用する MQTT 保持値を指定します (`true` または `false`)。これはオプションのフィールドで、省略した場合は retain には `false` が使用されます * `user` および `passwd`: MQTT broker がユーザ/パスワードベースの認証を必要とする場合に使用される オプションのフィールド。使用する場合は、両方のフィールドを一緒に使用する必要があります。セキュリティ上の理由から、 サブスクリプション情報を取得するときは常にパスワードが使用されないことに注意してください (例: `GET /v2/subscriptions`) @@ -48,7 +49,7 @@ MQTT サブスクリプションのカスタム通知 ([Orion API 仕様のカ * `httpCustom` の代わりに `mqttCustom` が使用されます * `mqtt` で使用されているのと同じフィールドを `mqttCustom` で使用できます * `headers`, `qs` と `method` は MQTT で同等ではないため、使用できません -* マクロ置換は `topic` および `payload` フィールドで実行されます。`url`, `qos`, `user` と `passwd` は固定値です +* マクロ置換は `topic` および `payload` フィールドで実行されます。`url`, `qos`, `retain`, `user` と `passwd` は固定値です ## 接続管理 @@ -83,3 +84,11 @@ TLS を使用して公開するには (Orion ではまだサポートされて ``` mosquitto_pub -d --insecure --cafile file.pem -h -p 1883 -u -P -t '/topic' -m 'payload' ``` + +Mosquitto Broker に保持されているすべてのメッセージをクリアするには: + +``` +sudo service mosquitto stop +sudo rm /var/lib/mosquitto/mosquitto.db +sudo systemctl start mosquitto.service +``` diff --git a/doc/manuals/admin/database_model.md b/doc/manuals/admin/database_model.md index 7041c77a19..ae438dbef6 100644 --- a/doc/manuals/admin/database_model.md +++ b/doc/manuals/admin/database_model.md @@ -283,8 +283,9 @@ Fields: is updated each time a notification is sent, to avoid violating throttling. - **throttling**: minimum interval between notifications. 0 or -1 means no throttling. - **reference**: the URL for notifications, either HTTP or MQTT -- **mqttTopic**: MQTT topic (only in MQTT notifications) -- **mqttQoS**: MQTT QoS value (only in MQTT notifications) +- **topic**: MQTT topic (only in MQTT notifications) +- **qos**: MQTT QoS value (only in MQTT notifications) +- **retain**: MQTT retain value (only in MQTT notifications) - **entities**: an array of entities (mandatory). The JSON for each entity contains **id**, **type**, **isPattern** and **isTypePattern**. Note that, due to legacy reasons, **isPattern** may be `"true"` or `"false"` (text) while diff --git a/doc/manuals/orion-api.md b/doc/manuals/orion-api.md index fd4d7ca7a5..23ecd1f5c0 100644 --- a/doc/manuals/orion-api.md +++ b/doc/manuals/orion-api.md @@ -3713,6 +3713,7 @@ A `mqtt` object contains the following subfields: | `url` | | string | Represent the MQTT broker endpoint to use. URL must start with `mqtt://` and never contains a path (it only includes host and port) | | `topic` | | string | Represent the MQTT topic to use | | `qos` | ✓ | number | MQTT QoS value to use in the notifications associated to the subscription (0, 1 or 2). If omitted then QoS 0 is used. | +| `retain` | ✓ | boolean | MQTT retain value to use in the notifications associated to the subscription (`true` or `false`). If omitted then retain `false` is used. | | `user` | ✓ | string | User name used to authenticate the connection with the broker. | | `passwd` | ✓ | string | Passphrase for the broker authentication. It is always obfuscated when retrieving subscription information (e.g. `GET /v2/subscriptions`). | @@ -3746,6 +3747,7 @@ A `mqttCustom` object contains the following subfields. | `url` | | string | Represent the MQTT broker endpoint to use. URL must start with `mqtt://` and never contains a path (it only includes host and port) | | `topic` | | string | Represent the MQTT topic to use. Macro replacement is also performed for this field (i.e: a topic based on an attribute ) | | `qos` | ✓ | number | MQTT QoS value to use in the notifications associated to the subscription (0, 1 or 2). If omitted then QoS 0 is used. | +| `retain` | ✓ | boolean | MQTT retain value to use in the notifications associated to the subscription (`true` or `false`). If omitted then retain `false` is used. | | `user` | ✓ | string | User name used to authenticate the connection with the broker. | | `passwd` | ✓ | string | Passphrase for the broker authentication. It is always obfuscated when retrieving subscription information (e.g. `GET /v2/subscriptions`). | | `payload` | ✓ | string | Text-based payload to be used in notifications. In case of empty string or omitted, the default payload (see [Notification Messages](#notification-messages) sections) is used. If `null`, notification will not include any payload. | diff --git a/doc/manuals/user/mqtt_notifications.md b/doc/manuals/user/mqtt_notifications.md index 08f7bd5654..a106e90010 100644 --- a/doc/manuals/user/mqtt_notifications.md +++ b/doc/manuals/user/mqtt_notifications.md @@ -30,6 +30,8 @@ The following elements can be used within `mqtt`: * `topic` to specify the MQTT topic to use * `qos`: to specify the MQTT QoS value to use in the notifications associated to the subscription (0, 1 or 2). This is an optional field, if omitted then QoS 0 is used. +* `retain`: to specify the MQTT retain value to use in the notifications associated to the subscription + (`true` or `false`). This is an optional field, if omitted then retain `false` is used. * `user` and `passwd`: optional fields, to be used in the case MQTT broker needs user/password based authentication. If used, both fields have to be used together. Note that for security reasons, the password is always offuscated when retrieving subscription information (e.g. `GET /v2/subscriptions`). @@ -52,7 +54,7 @@ in MQTT subscriptions work the same as in HTTP subscriptions, taking into accoun * `mqttCustom` is used instead of `httpCustom` * The same fields used in `mqtt` can be used in `mqttCustom`. * `headers`, `qs` and `method`cannot be used, as they doesn’t have equivalence in MQTT -* Macro replacement is performed in `topic` and `payload` fields. `url`, `qos`, `user` and `passwd` are fixed values +* Macro replacement is performed in `topic` and `payload` fields. `url`, `qos`, `retain`, `user` and `passwd` are fixed values ## Connection management @@ -88,3 +90,11 @@ To publish using TLS (not yet supported by Orion, pending on [this issue](https: mosquitto_pub -d --insecure --cafile file.pem -h -p 1883 -u -P -t '/topic' -m 'payload' ``` + +To clear all mosquitto broker retained messages: + +``` +sudo service mosquitto stop +sudo rm /var/lib/mosquitto/mosquitto.db +sudo systemctl start mosquitto.service +``` diff --git a/src/lib/apiTypesV2/MqttInfo.cpp b/src/lib/apiTypesV2/MqttInfo.cpp index 22958f93eb..d46b9e4507 100644 --- a/src/lib/apiTypesV2/MqttInfo.cpp +++ b/src/lib/apiTypesV2/MqttInfo.cpp @@ -68,6 +68,7 @@ std::string MqttInfo::toJson() jh.addString("url", this->url); jh.addString("topic", this->topic); jh.addNumber("qos", (long long) this->qos); + jh.addBool("retain", this->retain); if (providedAuth) { @@ -117,6 +118,7 @@ void MqttInfo::fill(const orion::BSONObj& bo) this->url = bo.hasField(CSUB_REFERENCE)? getStringFieldF(bo, CSUB_REFERENCE) : ""; this->topic = bo.hasField(CSUB_MQTTTOPIC)? getStringFieldF(bo, CSUB_MQTTTOPIC) : ""; this->qos = bo.hasField(CSUB_MQTTQOS)? getIntFieldF(bo, CSUB_MQTTQOS) : 0; + this->retain = bo.hasField(CSUB_MQTTRETAIN)? getBoolFieldF(bo, CSUB_MQTTRETAIN) : false; this->custom = bo.hasField(CSUB_CUSTOM)? getBoolFieldF(bo, CSUB_CUSTOM) : false; // both user and passwd have to be used at the same time @@ -228,6 +230,7 @@ void MqttInfo::fill(const MqttInfo& _mqttInfo) this->url = _mqttInfo.url; this->topic = _mqttInfo.topic; this->qos = _mqttInfo.qos; + this->retain = _mqttInfo.retain; this->custom = _mqttInfo.custom; this->payload = _mqttInfo.payload; this->payloadType = _mqttInfo.payloadType; diff --git a/src/lib/apiTypesV2/MqttInfo.h b/src/lib/apiTypesV2/MqttInfo.h index 8465d1c663..738e73c6a9 100644 --- a/src/lib/apiTypesV2/MqttInfo.h +++ b/src/lib/apiTypesV2/MqttInfo.h @@ -44,6 +44,7 @@ struct MqttInfo std::string url; std::string topic; unsigned int qos; // 0, 1 or 2 + bool retain; bool custom; std::string payload; // either payload, json or ngsi is used (depending on payloadType) diff --git a/src/lib/jsonParseV2/parseSubscription.cpp b/src/lib/jsonParseV2/parseSubscription.cpp index a70821df72..f68e11c259 100644 --- a/src/lib/jsonParseV2/parseSubscription.cpp +++ b/src/lib/jsonParseV2/parseSubscription.cpp @@ -649,6 +649,31 @@ static std::string parseMqttQoS(ConnectionInfo* ciP, SubscriptionUpdate* subsP, +/* **************************************************************************** +* +* parseMqttRetain - +*/ +static std::string parseMqttRetain(ConnectionInfo* ciP, SubscriptionUpdate* subsP, const Value& mqtt) +{ + Opt retainOpt = getBoolOpt(mqtt, "retain"); + if (!retainOpt.ok()) + { + return badInput(ciP, retainOpt.error); + } + if (retainOpt.given) + { + subsP->notification.mqttInfo.retain = retainOpt.value; + } + else + { + subsP->notification.mqttInfo.retain = 0; + } + + return ""; +} + + + /* **************************************************************************** * * parseMqttTopic - @@ -1035,6 +1060,13 @@ static std::string parseNotification(ConnectionInfo* ciP, SubscriptionUpdate* su return r; } + // retain + r = parseMqttRetain(ciP, subsP, mqtt); + if (!r.empty()) + { + return r; + } + // topic r = parseMqttTopic(ciP, subsP, mqtt); if (!r.empty()) @@ -1076,6 +1108,13 @@ static std::string parseNotification(ConnectionInfo* ciP, SubscriptionUpdate* su return r; } + // retain + r = parseMqttRetain(ciP, subsP, mqttCustom); + if (!r.empty()) + { + return r; + } + // topic (same as in not custom mqtt) r = parseMqttTopic(ciP, subsP, mqttCustom); if (!r.empty()) diff --git a/src/lib/mongoBackend/MongoCommonSubscription.cpp b/src/lib/mongoBackend/MongoCommonSubscription.cpp index c5f6c7a1e0..dd6bcf3101 100644 --- a/src/lib/mongoBackend/MongoCommonSubscription.cpp +++ b/src/lib/mongoBackend/MongoCommonSubscription.cpp @@ -286,12 +286,14 @@ void setNotificationInfo(const Subscription& sub, orion::BSONObjBuilder* b) b->append(CSUB_REFERENCE, sub.notification.mqttInfo.url); b->append(CSUB_MQTTTOPIC, sub.notification.mqttInfo.topic); b->append(CSUB_MQTTQOS, (int) sub.notification.mqttInfo.qos); + b->append(CSUB_MQTTRETAIN, sub.notification.mqttInfo.retain); b->append(CSUB_CUSTOM, sub.notification.mqttInfo.custom); - LM_T(LmtMongo, ("Subscription reference: %s", sub.notification.mqttInfo.url.c_str())); - LM_T(LmtMongo, ("Subscription mqttTopic: %s", sub.notification.mqttInfo.topic.c_str())); - LM_T(LmtMongo, ("Subscription mqttQos: %d", sub.notification.mqttInfo.qos)); - LM_T(LmtMongo, ("Subscription custom: %s", sub.notification.mqttInfo.custom? "true" : "false")); + LM_T(LmtMongo, ("Subscription reference: %s", sub.notification.mqttInfo.url.c_str())); + LM_T(LmtMongo, ("Subscription mqttTopic: %s", sub.notification.mqttInfo.topic.c_str())); + LM_T(LmtMongo, ("Subscription mqttQos: %d", sub.notification.mqttInfo.qos)); + LM_T(LmtMongo, ("Subscription mqttRetain: %s", sub.notification.mqttInfo.retain? "true": "false")); + LM_T(LmtMongo, ("Subscription custom: %s", sub.notification.mqttInfo.custom? "true" : "false")); if (sub.notification.mqttInfo.providedAuth) { diff --git a/src/lib/mongoBackend/dbConstants.h b/src/lib/mongoBackend/dbConstants.h index 4b231f975f..b55cf29925 100644 --- a/src/lib/mongoBackend/dbConstants.h +++ b/src/lib/mongoBackend/dbConstants.h @@ -128,6 +128,7 @@ #define CSUB_MQTTTOPIC "topic" #define CSUB_MQTTQOS "qos" +#define CSUB_MQTTRETAIN "retain" #define CSUB_USER "user" #define CSUB_PASSWD "passwd" diff --git a/src/lib/mongoBackend/mongoUpdateSubscription.cpp b/src/lib/mongoBackend/mongoUpdateSubscription.cpp index 177463aad3..c967b03519 100644 --- a/src/lib/mongoBackend/mongoUpdateSubscription.cpp +++ b/src/lib/mongoBackend/mongoUpdateSubscription.cpp @@ -69,6 +69,7 @@ void setNotificationInfo(const Subscription& sub, orion::BSONObjBuilder* setB, o { unsetB->append(CSUB_MQTTTOPIC, 1); unsetB->append(CSUB_MQTTQOS, 1); + unsetB->append(CSUB_MQTTRETAIN, 1); unsetB->append(CSUB_USER, 1); unsetB->append(CSUB_PASSWD, 1); diff --git a/src/lib/mqtt/MqttConnectionManager.cpp b/src/lib/mqtt/MqttConnectionManager.cpp index 7477b22cdf..00ef88b9a0 100644 --- a/src/lib/mqtt/MqttConnectionManager.cpp +++ b/src/lib/mqtt/MqttConnectionManager.cpp @@ -366,7 +366,7 @@ MqttConnection* MqttConnectionManager::getConnection(const std::string& host, in * * MqttConnectionManager::sendMqttNotification - */ -bool MqttConnectionManager::sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos) +bool MqttConnectionManager::sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos, bool retain) { std::string endpoint = getEndpoint(host, port); @@ -394,7 +394,7 @@ bool MqttConnectionManager::sendMqttNotification(const std::string& host, int po int id; bool retval; - int resultCode = mosquitto_publish(mosq, &id, topic.c_str(), (int) strlen(msg), msg, qos, false); + int resultCode = mosquitto_publish(mosq, &id, topic.c_str(), (int) strlen(msg), msg, qos, retain); if (resultCode != MOSQ_ERR_SUCCESS) { retval = false; diff --git a/src/lib/mqtt/MqttConnectionManager.h b/src/lib/mqtt/MqttConnectionManager.h index 97f8788c82..f80e1c25f6 100644 --- a/src/lib/mqtt/MqttConnectionManager.h +++ b/src/lib/mqtt/MqttConnectionManager.h @@ -69,7 +69,7 @@ class MqttConnectionManager const char* semGet(void); - bool sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos); + bool sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos, bool retain); void cleanup(double maxAge); private: diff --git a/src/lib/ngsiNotify/Notifier.cpp b/src/lib/ngsiNotify/Notifier.cpp index e76bf237fb..75865a4f4f 100644 --- a/src/lib/ngsiNotify/Notifier.cpp +++ b/src/lib/ngsiNotify/Notifier.cpp @@ -531,6 +531,7 @@ static SenderThreadParams* buildSenderParamsCustom paramsP->registration = false; paramsP->subscriptionId = subscriptionId.get(); paramsP->qos = notification.mqttInfo.qos; // unspecified in case of HTTP notifications + paramsP->retain = notification.mqttInfo.retain; // unspecified in case of HTTP notifications paramsP->timeout = notification.httpInfo.timeout; // unspecified in case of MQTT notifications paramsP->user = notification.mqttInfo.user; // unspecified in case of HTTP notifications paramsP->passwd = notification.mqttInfo.passwd; // unspecified in case of HTTP notifications @@ -714,6 +715,7 @@ SenderThreadParams* Notifier::buildSenderParams paramsP->subscriptionId = ncr.subscriptionId.get(); paramsP->registration = false; paramsP->qos = notification.mqttInfo.qos; // unspecified in case of HTTP notifications + paramsP->retain = notification.mqttInfo.retain; // unspecified in case of HTTP notifications paramsP->timeout = notification.httpInfo.timeout; // unspecified in case of MQTT notifications paramsP->user = notification.mqttInfo.user; // unspecified in case of HTTP notifications paramsP->passwd = notification.mqttInfo.passwd; // unspecified in case of HTTP notifications diff --git a/src/lib/ngsiNotify/doNotify.cpp b/src/lib/ngsiNotify/doNotify.cpp index e2785ce781..7598643047 100644 --- a/src/lib/ngsiNotify/doNotify.cpp +++ b/src/lib/ngsiNotify/doNotify.cpp @@ -158,7 +158,7 @@ static void doNotifyMqtt(SenderThreadParams* params) // Note that we use in subNotificationErrorStatus() statusCode -1 and failureReson "" to avoid using // lastFailureReason and lastSuccessCode in MQTT notifications (they don't have sense in this case) - if (mqttMgr.sendMqttNotification(params->ip, params->port, params->user, params->passwd, params->content, params->resource, params->qos)) + if (mqttMgr.sendMqttNotification(params->ip, params->port, params->user, params->passwd, params->content, params->resource, params->qos, params->retain)) { // MQTT transaction is logged only in the case it was actually published. Upon successful publishing // mqttOnPublishCallback is called (by the moment we are not doing nothing there, just printing in diff --git a/src/lib/ngsiNotify/senderThread.h b/src/lib/ngsiNotify/senderThread.h index 5141ab8b78..662902e0ed 100644 --- a/src/lib/ngsiNotify/senderThread.h +++ b/src/lib/ngsiNotify/senderThread.h @@ -60,6 +60,7 @@ typedef struct SenderThreadParams std::string xauthToken; std::string resource; // path for HTTP notifications, topic for MQTT notifications unsigned int qos; // used only in MQTT notifications + unsigned int retain; // used only in MQTT notifications std::string user; // for user/pass auth connections (only MQTT at the present moment) std::string passwd; // for user/pass auth connections (only MQTT at the present moment) std::string content_type; diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test index 2e4c940398..0c24073d89 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test @@ -261,7 +261,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 343 +Content-Length: 358 { "id": "REGEX([0-9a-f]{24})", @@ -275,6 +275,7 @@ Content-Length: 343 "x2": 2 }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -310,7 +311,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -321,6 +322,7 @@ Content-Length: 336 "mqttCustom": { "payload": "foo", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -356,7 +358,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 339 +Content-Length: 354 { "id": "REGEX([0-9a-f]{24})", @@ -370,6 +372,7 @@ Content-Length: 339 "zz" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -405,7 +408,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 335 +Content-Length: 350 { "id": "REGEX([0-9a-f]{24})", @@ -420,6 +423,7 @@ Content-Length: 335 3 ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -455,7 +459,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -466,6 +470,7 @@ Content-Length: 336 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -503,7 +508,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -514,6 +519,7 @@ Content-Length: 336 "mqttCustom": { "payload": "zzz", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -549,7 +555,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 352 +Content-Length: 367 { "id": "REGEX([0-9a-f]{24})", @@ -566,6 +572,7 @@ Content-Length: 352 ] }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -593,7 +600,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 691 +Content-Length: 721 [ { @@ -605,6 +612,7 @@ Content-Length: 691 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -639,6 +647,7 @@ Content-Length: 691 ] }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test index 7681c75fe2..d8fe2d436c 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test @@ -186,7 +186,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 916 +Content-Length: 946 [ { @@ -227,6 +227,7 @@ Content-Length: 916 "text": "foo" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -284,6 +285,7 @@ Content-Length: 916 } ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test index 9a56668ca2..954ed3bdba 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 838 +Content-Length: 868 [ { @@ -212,6 +212,7 @@ Content-Length: 838 "text": "${text}" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -247,6 +248,7 @@ Content-Length: 838 "${object}" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test index fb76352125..3a6f4a15c5 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test @@ -192,7 +192,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 851 +Content-Length: 881 [ { @@ -211,6 +211,7 @@ Content-Length: 851 "F": "ns:${object}" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -246,6 +247,7 @@ Content-Length: 851 "ns:${object}" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test index b6efd0d7cd..940492dc04 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 957 +Content-Length: 987 [ { @@ -212,6 +212,7 @@ Content-Length: 957 "F": "ns:${object}:${text}" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -247,6 +248,7 @@ Content-Length: 957 "ns:${object}:${text}" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test index ec23694b71..020245e27b 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test @@ -163,7 +163,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 751 +Content-Length: 781 [ { @@ -184,6 +184,7 @@ Content-Length: 751 ] }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -225,6 +226,7 @@ Content-Length: 751 ] ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test index 0055a407b8..d482101617 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test @@ -282,7 +282,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 2338 +Content-Length: 2428 [ { @@ -297,6 +297,7 @@ Content-Length: 2338 "mqttCustom": { "payload": "temperature:${temperature}", "qos": 0, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -328,6 +329,7 @@ Content-Length: 2338 "mqttCustom": { "payload": "temperature:${temperature}", "qos": 2, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -358,6 +360,7 @@ Content-Length: 2338 "covered": false, "mqttCustom": { "qos": 0, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -388,6 +391,7 @@ Content-Length: 2338 "covered": false, "mqttCustom": { "qos": 2, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -419,6 +423,7 @@ Content-Length: 2338 "mqttCustom": { "payload": null, "qos": 0, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -450,6 +455,7 @@ Content-Length: 2338 "mqttCustom": { "payload": null, "qos": 2, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test index cbabe14000..531e251861 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test @@ -204,7 +204,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 374 +Content-Length: 389 { "description": "Original sub", @@ -216,6 +216,7 @@ Content-Length: 374 "mqttCustom": { "payload": "t:${t}", "qos": 2, + "retain": false, "topic": "/orion/${d}", "url": "mqtt://localhost:1883" }, @@ -251,7 +252,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 374 +Content-Length: 389 { "description": "Modified sub", @@ -263,6 +264,7 @@ Content-Length: 374 "mqttCustom": { "payload": "t:${t}", "qos": 2, + "retain": false, "topic": "/orion/${d}", "url": "mqtt://localhost:1883" }, @@ -298,7 +300,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 367 +Content-Length: 382 { "description": "Modified sub", @@ -310,6 +312,7 @@ Content-Length: 367 "mqttCustom": { "payload": null, "qos": 0, + "retain": false, "topic": "/cb/${d}", "url": "mqtt://localhost:1884" }, @@ -389,7 +392,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 357 +Content-Length: 372 { "description": "Modified sub", @@ -400,6 +403,7 @@ Content-Length: 357 "covered": false, "mqttCustom": { "qos": 1, + "retain": false, "topic": "/orionbk/${d}", "url": "mqtt://localhost:1885" }, @@ -435,7 +439,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 344 +Content-Length: 359 { "description": "Modified sub", @@ -446,6 +450,7 @@ Content-Length: 344 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1887" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_notification.test b/test/functionalTest/cases/3001_mqtt/mqtt_notification.test index 5a938eb3c5..8e60fee1e6 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_notification.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_notification.test @@ -301,7 +301,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 1349 +Content-Length: 1379 [ { @@ -315,6 +315,7 @@ Content-Length: 1349 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://localhost:1883" }, @@ -346,6 +347,7 @@ Content-Length: 1349 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "sub2", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test b/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test index fdc5e520dc..ecc29badba 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test @@ -245,7 +245,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 494 +Content-Length: 509 [ { @@ -260,6 +260,7 @@ Content-Length: 494 "mqttCustom": { "payload": "{ %22A%22: %22${A}%22 }", "qos": 0, + "retain": false, "topic": "sub/${id}", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test b/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test index ae4e6b0330..a0adbcf1f6 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test @@ -270,7 +270,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 1357 +Content-Length: 1402 [ { @@ -284,6 +284,7 @@ Content-Length: 1357 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "sub0", "url": "mqtt://localhost:1883" }, @@ -315,6 +316,7 @@ Content-Length: 1357 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 1, + "retain": false, "topic": "sub1", "url": "mqtt://localhost:1883" }, @@ -346,6 +348,7 @@ Content-Length: 1357 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 2, + "retain": false, "topic": "sub2", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test index a697234c43..b1f8282f9f 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test @@ -124,7 +124,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 728 +Content-Length: 758 [ { @@ -138,6 +138,7 @@ Content-Length: 728 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "/orion/notif", "url": "mqtt://localhost:1883" }, @@ -168,6 +169,7 @@ Content-Length: 728 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion/notif", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test index dfe1dd1fd5..7ee82a77f2 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test @@ -177,7 +177,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 344 +Content-Length: 359 { "description": "Original sub", @@ -188,6 +188,7 @@ Content-Length: 344 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883" }, @@ -223,7 +224,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 344 +Content-Length: 359 { "description": "Modified sub", @@ -234,6 +235,7 @@ Content-Length: 344 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883" }, @@ -269,7 +271,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 341 +Content-Length: 356 { "description": "Modified sub", @@ -280,6 +282,7 @@ Content-Length: 341 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "/cb", "url": "mqtt://localhost:1884" }, @@ -359,7 +362,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 346 +Content-Length: 361 { "description": "Modified sub", @@ -370,6 +373,7 @@ Content-Length: 346 "covered": false, "mqtt": { "qos": 1, + "retain": false, "topic": "/orionbk", "url": "mqtt://localhost:1885" }, diff --git a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test index 48bf71ec62..0877eb5d53 100644 --- a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test +++ b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -208,6 +208,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -247,7 +248,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -262,6 +263,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -309,7 +311,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 551 +Content-Length: 566 [ { @@ -324,6 +326,7 @@ Content-Length: 551 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "SeY7oD5XPa1UENBiOLPHqWXmj4r4OZHu4tsgWn1AmTkQuMW6lCDCmqMvi1oURVfJ" diff --git a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test index 7dd4c95c83..caf1d9af57 100644 --- a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test +++ b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -208,6 +208,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -247,7 +248,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -262,6 +263,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -309,7 +311,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 551 +Content-Length: 566 [ { @@ -324,6 +326,7 @@ Content-Length: 551 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "SeY7oD5XPa1UENBiOLPHqWXmj4r4OZHu4tsgWn1AmTkQuMW6lCDCmqMvi1oURVfJ" diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test index 7a0aa8de76..28e5775da4 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test @@ -136,7 +136,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -149,6 +149,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -177,7 +178,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -190,6 +191,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -218,7 +220,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -231,6 +233,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test index daf48d9ca5..ee6791cdc8 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test @@ -160,7 +160,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -173,6 +173,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -215,7 +216,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -228,6 +229,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -256,7 +258,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -269,6 +271,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test index 4600ff39a3..a2a06ea556 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test @@ -209,7 +209,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -222,6 +222,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -273,7 +274,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 471 +Content-Length: 486 { "id": "REGEX([0-9a-f]{24})", @@ -287,6 +288,7 @@ Content-Length: 471 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -327,7 +329,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -340,6 +342,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -368,7 +371,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -381,6 +384,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test index 919209336e..4beb19c195 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test @@ -147,7 +147,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 448 +Content-Length: 463 { "id": "REGEX([0-9a-f]{24})", @@ -161,6 +161,7 @@ Content-Length: 448 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -205,7 +206,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -219,6 +220,7 @@ Content-Length: 450 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test index d3025113ae..5c4d464fed 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test @@ -213,7 +213,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 448 +Content-Length: 463 { "id": "REGEX([0-9a-f]{24})", @@ -227,6 +227,7 @@ Content-Length: 448 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -264,7 +265,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 448 +Content-Length: 463 { "id": "REGEX([0-9a-f]{24})", @@ -278,6 +279,7 @@ Content-Length: 448 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -315,7 +317,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -329,6 +331,7 @@ Content-Length: 450 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -379,7 +382,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 472 +Content-Length: 487 { "id": "REGEX([0-9a-f]{24})", @@ -393,6 +396,7 @@ Content-Length: 472 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test index c6c880b177..bf996cffea 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test @@ -423,7 +423,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 431 +Content-Length: 446 { "id": "REGEX([0-9a-f]{24})", @@ -436,6 +436,7 @@ Content-Length: 431 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -486,7 +487,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 489 +Content-Length: 504 { "id": "REGEX([0-9a-f]{24})", @@ -501,6 +502,7 @@ Content-Length: 489 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -538,7 +540,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -553,6 +555,7 @@ Content-Length: 491 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -599,7 +602,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -614,6 +617,7 @@ Content-Length: 491 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -659,7 +663,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -674,6 +678,7 @@ Content-Length: 491 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -719,7 +724,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 489 +Content-Length: 504 { "id": "REGEX([0-9a-f]{24})", @@ -734,6 +739,7 @@ Content-Length: 489 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -771,7 +777,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -786,6 +792,7 @@ Content-Length: 491 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -832,7 +839,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -847,6 +854,7 @@ Content-Length: 491 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -897,7 +905,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 472 +Content-Length: 487 { "id": "REGEX([0-9a-f]{24})", @@ -911,6 +919,7 @@ Content-Length: 472 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test index 64924a08d7..8dde8abcaa 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test @@ -200,7 +200,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 461 +Content-Length: 476 { "id": "REGEX([0-9a-f]{24})", @@ -214,6 +214,7 @@ Content-Length: 461 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:18883" }, @@ -254,7 +255,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 461 +Content-Length: 476 { "id": "REGEX([0-9a-f]{24})", @@ -268,6 +269,7 @@ Content-Length: 461 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:18883" }, @@ -296,7 +298,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 461 +Content-Length: 476 { "id": "REGEX([0-9a-f]{24})", @@ -310,6 +312,7 @@ Content-Length: 461 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:18883" }, @@ -350,7 +353,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 461 +Content-Length: 476 { "id": "REGEX([0-9a-f]{24})", @@ -364,6 +367,7 @@ Content-Length: 461 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:18883" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test index af5f483d41..63b9cf3457 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test @@ -150,7 +150,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -164,6 +164,7 @@ Content-Length: 450 "maxFailsLimit": 1, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -196,7 +197,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -210,6 +211,7 @@ Content-Length: 450 "maxFailsLimit": 1, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test index 36de9e0cae..81a098ad92 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test @@ -278,7 +278,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 415 +Content-Length: 430 { "description": "A subscription to get info about Room1", @@ -292,6 +292,7 @@ Content-Length: 415 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -329,7 +330,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -346,6 +347,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -384,7 +386,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -401,6 +403,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -439,7 +442,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -456,6 +459,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -494,7 +498,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -511,6 +515,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -549,7 +554,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -566,6 +571,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -604,7 +610,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 535 +Content-Length: 550 { "description": "A subscription to get info about Room1", @@ -621,6 +627,7 @@ Content-Length: 535 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test index 3384f44620..eee0a0d2ec 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test @@ -212,7 +212,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 415 +Content-Length: 430 { "description": "A subscription to get info about Room1", @@ -226,6 +226,7 @@ Content-Length: 415 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -263,7 +264,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -280,6 +281,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -318,7 +320,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -335,6 +337,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -378,7 +381,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 557 +Content-Length: 572 { "description": "A subscription to get info about Room1", @@ -395,6 +398,7 @@ Content-Length: 557 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test index 509f30e420..135d8d9e85 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test @@ -147,7 +147,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 397 +Content-Length: 412 { "description": "A subscription to get info about Room1", @@ -160,6 +160,7 @@ Content-Length: 397 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -197,7 +198,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 515 +Content-Length: 530 { "description": "A subscription to get info about Room1", @@ -213,6 +214,7 @@ Content-Length: 515 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test index 0f6f35c602..95d03e9ebd 100644 --- a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test +++ b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test @@ -317,7 +317,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 351 +Content-Length: 366 { "id": "REGEX([0-9a-f\-]{24})", @@ -328,6 +328,7 @@ Content-Length: 351 "mqttCustom": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883", "user": "user1" @@ -370,7 +371,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 352 +Content-Length: 367 { "id": "REGEX([0-9a-f\-]{24})", @@ -381,6 +382,7 @@ Content-Length: 352 "mqttCustom": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883", "user": "user10" @@ -423,7 +425,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 319 +Content-Length: 334 { "id": "REGEX([0-9a-f\-]{24})", @@ -433,6 +435,7 @@ Content-Length: 319 "covered": false, "mqttCustom": { "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883" }, @@ -474,7 +477,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 351 +Content-Length: 366 { "id": "REGEX([0-9a-f\-]{24})", @@ -485,6 +488,7 @@ Content-Length: 351 "mqttCustom": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883", "user": "user1" diff --git a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test index 7fff7ecd70..2b149a5221 100644 --- a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test +++ b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test @@ -317,7 +317,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 345 +Content-Length: 360 { "id": "REGEX([0-9a-f\-]{24})", @@ -328,6 +328,7 @@ Content-Length: 345 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883", "user": "user1" @@ -370,7 +371,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 346 +Content-Length: 361 { "id": "REGEX([0-9a-f\-]{24})", @@ -381,6 +382,7 @@ Content-Length: 346 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883", "user": "user10" @@ -423,7 +425,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 313 +Content-Length: 328 { "id": "REGEX([0-9a-f\-]{24})", @@ -433,6 +435,7 @@ Content-Length: 313 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883" }, @@ -474,7 +477,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 345 +Content-Length: 360 { "id": "REGEX([0-9a-f\-]{24})", @@ -485,6 +488,7 @@ Content-Length: 345 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883", "user": "user1" diff --git a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_attr_no_type.test b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_attr_no_type.test index 3d4e8bd991..8043fd7c4f 100644 --- a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_attr_no_type.test +++ b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_attr_no_type.test @@ -111,7 +111,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 585 +Content-Length: 600 { "id": "REGEX([0-9a-f]{24})", @@ -155,6 +155,7 @@ Content-Length: 585 "type": "T1" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud.test b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud.test index 1d8121bac6..c08b1ab6ca 100644 --- a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud.test +++ b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud.test @@ -282,7 +282,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 383 +Content-Length: 398 { "id": "REGEX([0-9a-f]{24})", @@ -300,6 +300,7 @@ Content-Length: 383 "type": "T1" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -335,7 +336,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -346,6 +347,7 @@ Content-Length: 336 "mqttCustom": { "payload": "foo", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -381,7 +383,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 383 +Content-Length: 398 { "id": "REGEX([0-9a-f]{24})", @@ -399,6 +401,7 @@ Content-Length: 383 "type": "T2" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -434,7 +437,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 383 +Content-Length: 398 { "id": "REGEX([0-9a-f]{24})", @@ -452,6 +455,7 @@ Content-Length: 383 "type": "T3" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -487,7 +491,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -498,6 +502,7 @@ Content-Length: 336 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -535,7 +540,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -546,6 +551,7 @@ Content-Length: 336 "mqttCustom": { "payload": "zzz", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -581,7 +587,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 383 +Content-Length: 398 { "id": "REGEX([0-9a-f]{24})", @@ -599,6 +605,7 @@ Content-Length: 383 "type": "T4" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -626,7 +633,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 722 +Content-Length: 752 [ { @@ -638,6 +645,7 @@ Content-Length: 722 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -673,6 +681,7 @@ Content-Length: 722 "type": "T4" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_compounds.test b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_compounds.test index d43d899140..fcbbb8f196 100644 --- a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_compounds.test +++ b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_compounds.test @@ -300,7 +300,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 432 +Content-Length: 447 { "id": "REGEX([0-9a-f]{24})", @@ -327,6 +327,7 @@ Content-Length: 432 "type": "T1" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -362,7 +363,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -373,6 +374,7 @@ Content-Length: 336 "mqttCustom": { "payload": "foo", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -408,7 +410,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 433 +Content-Length: 448 { "id": "REGEX([0-9a-f]{24})", @@ -439,6 +441,7 @@ Content-Length: 433 "type": "T2" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -474,7 +477,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 429 +Content-Length: 444 { "id": "REGEX([0-9a-f]{24})", @@ -501,6 +504,7 @@ Content-Length: 429 "type": "T3" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -536,7 +540,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -547,6 +551,7 @@ Content-Length: 336 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -584,7 +589,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -595,6 +600,7 @@ Content-Length: 336 "mqttCustom": { "payload": "zzz", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -630,7 +636,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 435 +Content-Length: 450 { "id": "REGEX([0-9a-f]{24})", @@ -661,6 +667,7 @@ Content-Length: 435 "type": "T4" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_partial.test b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_partial.test index cb9a38840a..4ed1f9ce81 100644 --- a/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_partial.test +++ b/test/functionalTest/cases/4085_custom_notifications_ngsi_payload/custom_notification_mqtt_ngsi_basic_crud_partial.test @@ -266,7 +266,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 371 +Content-Length: 386 { "id": "REGEX([0-9a-f]{24})", @@ -283,6 +283,7 @@ Content-Length: 371 "id": "E1" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -318,7 +319,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -329,6 +330,7 @@ Content-Length: 336 "mqttCustom": { "payload": "foo", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -364,7 +366,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 361 +Content-Length: 376 { "id": "REGEX([0-9a-f]{24})", @@ -380,6 +382,7 @@ Content-Length: 361 } }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -415,7 +418,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 351 +Content-Length: 366 { "id": "REGEX([0-9a-f]{24})", @@ -429,6 +432,7 @@ Content-Length: 351 "type": "T3" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -464,7 +468,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -475,6 +479,7 @@ Content-Length: 336 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -512,7 +517,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -523,6 +528,7 @@ Content-Length: 336 "mqttCustom": { "payload": "zzz", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -558,7 +564,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 373 +Content-Length: 388 { "id": "REGEX([0-9a-f]{24})", @@ -575,6 +581,7 @@ Content-Length: 373 "type": "T4" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_basic_crud.test b/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_basic_crud.test new file mode 100644 index 0000000000..9aff1e0a20 --- /dev/null +++ b/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_basic_crud.test @@ -0,0 +1,689 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Basic CRUD for subscriptions retain field (mqttCustom variant) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0-255 + +--SHELL-- + +# +# 01. Create subscription with invalid retain, see error +# 02. Create subscription with retain true +# 03a. Get subscription and see retain true +# 03b. Get subscription (as a list) and see retain true +# 04. Update subscription with retain false +# 05a. Get subscription and see retain false +# 05b. Get subscription (as a list) and see retain false +# 06. Update subscription without retain +# 07a. Get subscription and see retain false +# 07b. Get subscription (as a list) and see retain false +# 08. Update subscription with retain true +# 09a. Get subscription and see retain true +# 09b. Get subscription (as a list) and see retain true +# 10. Update subscription with invalid retain, see error +# 11a. Get subscription and see retain true +# 11b. Get subscription (as a list) and see retain true +# + +echo "01. Create subscription with invalid retain, see error" +echo "======================================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": "foo" + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create subscription with retain true" +echo "========================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": true + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +SUB_ID=$(echo "$_responseHeaders" | grep Location | awk -F/ '{ print $4 }' | tr -d "\r\n") + + +echo "03a. Get subscription and see retain true" +echo "=========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "03b. Get subscription (as a list) and see retain true" +echo "=====================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "04. Update subscription with retain false" +echo "=========================================" +payload='{ + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": false + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "05a. Get subscription and see retain false" +echo "==========================================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "05b. Get subscription (as a list) and see retain false" +echo "======================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "06. Update subscription without retain" +echo "======================================" +payload='{ + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion" + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "07a. Get subscription and see retain false" +echo "==========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "07b. Get subscription (as a list) and see retain false" +echo "======================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "08. Update subscription with retain true" +echo "========================================" +payload='{ + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": true + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "09a. Get subscription and see retain true" +echo "=========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "09b. Get subscription (as a list) and see retain true" +echo "=====================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "10. Update subscription with invalid retain, see error" +echo "======================================================" +payload='{ + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": 42 + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "11a. Get subscription and see retain true" +echo "=========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "11b. Get subscription (as a list) and see retain true" +echo "=====================================================" +orionCurl --url /v2/subscriptions +echo +echo + +--REGEXPECT-- +01. Create subscription with invalid retain, see error +====================================================== +HTTP/1.1 400 Bad Request +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 59 + +{ + "description": "retain is not a bool", + "error": "BadRequest" +} + + +02. Create subscription with retain true +======================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +03a. Get subscription and see retain true +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 340 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +03b. Get subscription (as a list) and see retain true +===================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 342 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +04. Update subscription with retain false +========================================= +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05a. Get subscription and see retain false +========================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 341 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +05b. Get subscription (as a list) and see retain false +====================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 343 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +06. Update subscription without retain +====================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +07a. Get subscription and see retain false +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 341 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +07b. Get subscription (as a list) and see retain false +====================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 343 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +08. Update subscription with retain true +======================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +09a. Get subscription and see retain true +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 340 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +09b. Get subscription (as a list) and see retain true +===================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 342 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +10. Update subscription with invalid retain, see error +====================================================== +HTTP/1.1 400 Bad Request +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 59 + +{ + "description": "retain is not a bool", + "error": "BadRequest" +} + + +11a. Get subscription and see retain true +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 340 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +11b. Get subscription (as a list) and see retain true +===================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 342 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqttCustom": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_false.test b/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_false.test new file mode 100644 index 0000000000..813cd75006 --- /dev/null +++ b/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_false.test @@ -0,0 +1,167 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Notification with retain false (mqttCustom variant) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0-255 + +# To avoid an existing hanged accumulator due to a previous test could interfere +accumulatorStop + +--SHELL-- + +# +# 01. Create subscription with retain false +# 02. Create entity so notification is sent to MQTT broker +# 03. Connect accumulator-server as MQTT client to the notification topic +# 04. Update entity to sent a second notification +# 05. Dump accumular and check only second notifications arrived +# + + +echo "01. Create subscription with retain false" +echo "=========================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion/notretain/custom", + "retain": false + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create entity so notification is sent to MQTT broker" +echo "========================================================" +payload='{ + "id": "E", + "type": "T", + "A": { + "value": 1, + "type": "Number" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. Connect accumulator-server as MQTT client to the notification topic" +echo "=======================================================================" +accumulatorStart --pretty-print --mqttHost ${MQTT_HOST} --mqttPort ${MQTT_PORT} --mqttTopic "orion/notretain/custom" +echo +echo + + +echo "04. Update entity to sent a second notification" +echo "===============================================" +payload='{ + "A": { + "value": 2, + "type": "Number" + } +}' +orionCurl --url /v2/entities/E/attrs --payload "$payload" +echo +echo + + +echo "05. Dump accumular and check only second notifications arrived" +echo "==============================================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. Create subscription with retain false +========================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Create entity so notification is sent to MQTT broker +======================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E?type=T +Content-Length: 0 + + + +03. Connect accumulator-server as MQTT client to the notification topic +======================================================================= +accumulator running as PID REGEX(\d+) + + +04. Update entity to sent a second notification +=============================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Dump accumular and check only second notifications arrived +============================================================== +MQTT message at topic orion/notretain/custom: +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Number", + "value": 2 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop diff --git a/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_true.test b/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_true.test new file mode 100644 index 0000000000..0a1dcf373d --- /dev/null +++ b/test/functionalTest/cases/4388_mqtt_retain/mqttCustom_retain_true.test @@ -0,0 +1,183 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Notification with retain true (mqttCustom variant) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0-255 + +# To avoid an existing hanged accumulator due to a previous test could interfere +accumulatorStop + +--SHELL-- + +# +# 01. Create subscription with retain true +# 02. Create entity so notification is sent to MQTT broker +# 03. Connect accumulator-server as MQTT client to the notification topic +# 04. Update entity to sent a second notification +# 05. Dump accumular and check two notifications arrived +# + + +echo "01. Create subscription with retain true" +echo "========================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqttCustom": { + "url": "mqtt://localhost:1883", + "topic": "orion/retain/custom", + "retain": true + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create entity so notification is sent to MQTT broker" +echo "========================================================" +payload='{ + "id": "E", + "type": "T", + "A": { + "value": 1, + "type": "Number" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. Connect accumulator-server as MQTT client to the notification topic" +echo "=======================================================================" +accumulatorStart --pretty-print --mqttHost ${MQTT_HOST} --mqttPort ${MQTT_PORT} --mqttTopic "orion/retain/custom" +echo +echo + + +echo "04. Update entity to sent a second notification" +echo "===============================================" +payload='{ + "A": { + "value": 2, + "type": "Number" + } +}' +orionCurl --url /v2/entities/E/attrs --payload "$payload" +echo +echo + + +echo "05. Dump accumular and check two notifications arrived" +echo "======================================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. Create subscription with retain true +======================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Create entity so notification is sent to MQTT broker +======================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E?type=T +Content-Length: 0 + + + +03. Connect accumulator-server as MQTT client to the notification topic +======================================================================= +accumulator running as PID REGEX(\d+) + + +04. Update entity to sent a second notification +=============================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Dump accumular and check two notifications arrived +====================================================== +MQTT message at topic orion/retain/custom: +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +MQTT message at topic orion/retain/custom: +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Number", + "value": 2 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop diff --git a/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_basic_crud.test b/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_basic_crud.test new file mode 100644 index 0000000000..54cb2be413 --- /dev/null +++ b/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_basic_crud.test @@ -0,0 +1,689 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Basic CRUD for subscriptions retain field (mqtt variant) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0-255 + +--SHELL-- + +# +# 01. Create subscription with invalid retain, see error +# 02. Create subscription with retain true +# 03a. Get subscription and see retain true +# 03b. Get subscription (as a list) and see retain true +# 04. Update subscription with retain false +# 05a. Get subscription and see retain false +# 05b. Get subscription (as a list) and see retain false +# 06. Update subscription without retain +# 07a. Get subscription and see retain false +# 07b. Get subscription (as a list) and see retain false +# 08. Update subscription with retain true +# 09a. Get subscription and see retain true +# 09b. Get subscription (as a list) and see retain true +# 10. Update subscription with invalid retain, see error +# 11a. Get subscription and see retain true +# 11b. Get subscription (as a list) and see retain true +# + +echo "01. Create subscription with invalid retain, see error" +echo "======================================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": "foo" + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create subscription with retain true" +echo "========================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": true + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +SUB_ID=$(echo "$_responseHeaders" | grep Location | awk -F/ '{ print $4 }' | tr -d "\r\n") + + +echo "03a. Get subscription and see retain true" +echo "=========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "03b. Get subscription (as a list) and see retain true" +echo "=====================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "04. Update subscription with retain false" +echo "=========================================" +payload='{ + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": false + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "05a. Get subscription and see retain false" +echo "==========================================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "05b. Get subscription (as a list) and see retain false" +echo "======================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "06. Update subscription without retain" +echo "======================================" +payload='{ + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion" + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "07a. Get subscription and see retain false" +echo "==========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "07b. Get subscription (as a list) and see retain false" +echo "======================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "08. Update subscription with retain true" +echo "========================================" +payload='{ + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": true + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "09a. Get subscription and see retain true" +echo "=========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "09b. Get subscription (as a list) and see retain true" +echo "=====================================================" +orionCurl --url /v2/subscriptions +echo +echo + + +echo "10. Update subscription with invalid retain, see error" +echo "======================================================" +payload='{ + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion", + "retain": 42 + } + } +}' +orionCurl --url /v2/subscriptions/$SUB_ID --payload "$payload" -X PATCH +echo +echo + + +echo "11a. Get subscription and see retain true" +echo "=========================================" +orionCurl --url /v2/subscriptions/$SUB_ID +echo +echo + + +echo "11b. Get subscription (as a list) and see retain true" +echo "=====================================================" +orionCurl --url /v2/subscriptions +echo +echo + +--REGEXPECT-- +01. Create subscription with invalid retain, see error +====================================================== +HTTP/1.1 400 Bad Request +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 59 + +{ + "description": "retain is not a bool", + "error": "BadRequest" +} + + +02. Create subscription with retain true +======================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +03a. Get subscription and see retain true +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 334 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +03b. Get subscription (as a list) and see retain true +===================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 336 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +04. Update subscription with retain false +========================================= +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05a. Get subscription and see retain false +========================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 335 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +05b. Get subscription (as a list) and see retain false +====================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 337 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +06. Update subscription without retain +====================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +07a. Get subscription and see retain false +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 335 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +07b. Get subscription (as a list) and see retain false +====================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 337 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +08. Update subscription with retain true +======================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +09a. Get subscription and see retain true +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 334 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +09b. Get subscription (as a list) and see retain true +===================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 336 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +10. Update subscription with invalid retain, see error +====================================================== +HTTP/1.1 400 Bad Request +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 59 + +{ + "description": "retain is not a bool", + "error": "BadRequest" +} + + +11a. Get subscription and see retain true +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 334 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } +} + + +11b. Get subscription (as a list) and see retain true +===================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 336 + +[ + { + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "mqtt": { + "qos": 0, + "retain": true, + "topic": "orion", + "url": "mqtt://localhost:1883" + }, + "onlyChangedAttrs": false + }, + "status": "active", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "T" + } + ] + } + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_false.test b/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_false.test new file mode 100644 index 0000000000..925e11a8a7 --- /dev/null +++ b/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_false.test @@ -0,0 +1,167 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Notification with retain false (mqtt variant) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0-255 + +# To avoid an existing hanged accumulator due to a previous test could interfere +accumulatorStop + +--SHELL-- + +# +# 01. Create subscription with retain false +# 02. Create entity so notification is sent to MQTT broker +# 03. Connect accumulator-server as MQTT client to the notification topic +# 04. Update entity to sent a second notification +# 05. Dump accumular and check only second notifications arrived +# + + +echo "01. Create subscription with retain false" +echo "=========================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion/notretain", + "retain": false + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create entity so notification is sent to MQTT broker" +echo "========================================================" +payload='{ + "id": "E", + "type": "T", + "A": { + "value": 1, + "type": "Number" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. Connect accumulator-server as MQTT client to the notification topic" +echo "=======================================================================" +accumulatorStart --pretty-print --mqttHost ${MQTT_HOST} --mqttPort ${MQTT_PORT} --mqttTopic "orion/notretain" +echo +echo + + +echo "04. Update entity to sent a second notification" +echo "===============================================" +payload='{ + "A": { + "value": 2, + "type": "Number" + } +}' +orionCurl --url /v2/entities/E/attrs --payload "$payload" +echo +echo + + +echo "05. Dump accumular and check only second notifications arrived" +echo "==============================================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. Create subscription with retain false +========================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Create entity so notification is sent to MQTT broker +======================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E?type=T +Content-Length: 0 + + + +03. Connect accumulator-server as MQTT client to the notification topic +======================================================================= +accumulator running as PID REGEX(\d+) + + +04. Update entity to sent a second notification +=============================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Dump accumular and check only second notifications arrived +============================================================== +MQTT message at topic orion/notretain: +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Number", + "value": 2 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop diff --git a/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_true.test b/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_true.test new file mode 100644 index 0000000000..93d0eb9f63 --- /dev/null +++ b/test/functionalTest/cases/4388_mqtt_retain/mqtt_retain_true.test @@ -0,0 +1,183 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Notification with retain true (mqtt variant) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0-255 + +# To avoid an existing hanged accumulator due to a previous test could interfere +accumulatorStop + +--SHELL-- + +# +# 01. Create subscription with retain true +# 02. Create entity so notification is sent to MQTT broker +# 03. Connect accumulator-server as MQTT client to the notification topic +# 04. Update entity to sent a second notification +# 05. Dump accumular and check two notifications arrived +# + + +echo "01. Create subscription with retain true" +echo "========================================" +payload='{ + "subject": { + "entities": [ + { + "idPattern" : ".*", + "type": "T" + } + ] + }, + "notification": { + "mqtt": { + "url": "mqtt://localhost:1883", + "topic": "orion/retain", + "retain": true + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create entity so notification is sent to MQTT broker" +echo "========================================================" +payload='{ + "id": "E", + "type": "T", + "A": { + "value": 1, + "type": "Number" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. Connect accumulator-server as MQTT client to the notification topic" +echo "=======================================================================" +accumulatorStart --pretty-print --mqttHost ${MQTT_HOST} --mqttPort ${MQTT_PORT} --mqttTopic "orion/retain" +echo +echo + + +echo "04. Update entity to sent a second notification" +echo "===============================================" +payload='{ + "A": { + "value": 2, + "type": "Number" + } +}' +orionCurl --url /v2/entities/E/attrs --payload "$payload" +echo +echo + + +echo "05. Dump accumular and check two notifications arrived" +echo "======================================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. Create subscription with retain true +======================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Create entity so notification is sent to MQTT broker +======================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E?type=T +Content-Length: 0 + + + +03. Connect accumulator-server as MQTT client to the notification topic +======================================================================= +accumulator running as PID REGEX(\d+) + + +04. Update entity to sent a second notification +=============================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Dump accumular and check two notifications arrived +====================================================== +MQTT message at topic orion/retain: +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +MQTT message at topic orion/retain: +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Number", + "value": 2 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop