You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-3454: From MQTT conversion error - to error ch (#3456)
* GH-3454: From MQTT conversion error - to error ch
Fixes#3454
The message converter may return null when we try to covert from the
MQTT message.
The thrown exception may also reset the client connect.
* Fix `MqttPahoMessageDrivenChannelAdapter` to catch any conversion errors
(including `null` result) and try to send an `ErrorMessage` with that info
into the provided `errorChannel`.
Otherwise re-throw it as as
**Cherry-pick to `5.4.x` & `5.3.x`**
* * Apply review language-specific changes
Copy file name to clipboardExpand all lines: spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java
+47-12Lines changed: 47 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2020 the original author or authors.
2
+
* Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/mqtt.adoc
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ Starting with version 5.3, you can set the `manualAcks` property to true.
154
154
Often used to asynchronously acknowledge delivery.
155
155
When set to `true`, header (`IntegrationMessageHeaderAccessor.ACKNOWLEDGMENT_CALLBACK`) is added to the message with the value being a `SimpleAcknowledgment`.
156
156
You must invoke the `acknowledge()` method to complete the delivery.
157
-
See the Javadocs for `IMqppClient` `setManualAcks()` and `messageArrivedComplete()` for more information.
157
+
See the Javadocs for `IMqttClient` `setManualAcks()` and `messageArrivedComplete()` for more information.
Starting with version `5.2.11`, when the message converter throws an exception or returns `null` from the `MqttMessage` conversion, the `MqttPahoMessageDrivenChannelAdapter` sends an `ErrorMessage` into the `errorChannel`, if provided.
168
+
Re-throws this conversion error otherwise into an MQTT client callback.
169
+
167
170
==== Configuring with Java Configuration
168
171
169
172
The following Spring Boot application shows an example of how to configure the inbound adapter with Java configuration:
0 commit comments