Skip to content

Commit 5726ff2

Browse files
use atmostonce for jwt request
Signed-off-by: Pradeep Kumar K J <pkj@softwareag.com>
1 parent efd5d33 commit 5726ff2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crates/core/c8y_api/src/http_proxy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ impl C8yMqttJwtTokenRetriever {
132132
for _ in 0..3 {
133133
mqtt_con
134134
.published
135-
.publish(mqtt_channel::Message::new(
136-
&Topic::new_unchecked("c8y/s/uat"),
137-
"".to_string(),
138-
))
135+
.publish(
136+
mqtt_channel::Message::new(&Topic::new_unchecked("c8y/s/uat"), "".to_string())
137+
.with_qos(mqtt_channel::QoS::AtMostOnce),
138+
)
139139
.await?;
140140
info!("JWT token requested");
141141

crates/core/tedge/src/cli/connect/bridge_config_c8y.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ impl From<BridgeConfigC8yParams> for BridgeConfig {
5959
r#"alarm/alarms/create out 2 c8y/ """#.into(),
6060
r#"error in 2 c8y/ """#.into(),
6161
// c8y JWT token retrieval
62-
r#"s/uat out 2 c8y/ """#.into(),
63-
r#"s/dat in 2 c8y/ """#.into(),
62+
r#"s/uat out 0 c8y/ """#.into(),
63+
r#"s/dat in 0 c8y/ """#.into(),
6464
];
6565

6666
let templates_set = smartrest_templates
@@ -199,8 +199,8 @@ fn test_bridge_config_from_c8y_params() -> anyhow::Result<()> {
199199
r#"alarm/alarms/create out 2 c8y/ """#.into(),
200200
r#"error in 2 c8y/ """#.into(),
201201
// c8y JWT token retrieval
202-
r#"s/uat out 2 c8y/ """#.into(),
203-
r#"s/dat in 2 c8y/ """#.into(),
202+
r#"s/uat out 0 c8y/ """#.into(),
203+
r#"s/dat in 0 c8y/ """#.into(),
204204
// Smartrest templates should be deserialized as:
205205
// s/uc/template-1 (in from localhost), s/uc/template-1
206206
// s/dc/template-1 (out to localhost), s/dc/template-1

0 commit comments

Comments
 (0)