-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Apply NullAbility to MQTT module #10274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Message<?> toMessage(byte[] bytes, @Nullable Map<String, Object> headers); | ||
|
||
@Override | ||
byte @NonNull [] fromMessage(Message<?> message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don’t need @NonNull
at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, yes. removed.
@@ -34,7 +36,7 @@ public class MqttMessageNotDeliveredEvent extends MqttMessageDeliveryEvent { | |||
|
|||
private final Throwable exception; | |||
|
|||
public MqttMessageNotDeliveredEvent(Object source, int messageId, String clientId, | |||
public MqttMessageNotDeliveredEvent(Object source, int messageId, @Nullable String clientId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to revise clientId
. It is not null this or other way.
See AbstractMqttClientManager.getClientId()
.
We should utilize that in the AbstractMqttMessageHandler.getClientId()
as an if..else
to return provided clientId
or the one supplied by the clientManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. i extract getClientId()
to the top ClientManager
interface. also getUrl()
.
for inbound/outbound adapters, in their ctors, if url/client not provided, will be assigned from the clientManager.
...va/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java
Show resolved
Hide resolved
...n/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java
Outdated
Show resolved
Hide resolved
Related to: spring-projects#10083 Signed-off-by: Jiandong Ma <[email protected]>
Signed-off-by: Jiandong Ma <[email protected]>
Signed-off-by: Jiandong Ma <[email protected]>
...n/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java
Outdated
Show resolved
Hide resolved
...java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java
Outdated
Show resolved
Hide resolved
...java/org/springframework/integration/mqtt/inbound/Mqttv5PahoMessageDrivenChannelAdapter.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java
Outdated
Show resolved
Hide resolved
suppress with NullAway for `toMessageBuilder` in v3 inbound adapter. Signed-off-by: Jiandong Ma <[email protected]>
…gration into jspecify-mqtt
...n/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java
Outdated
Show resolved
Hide resolved
...n/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jiandong Ma <[email protected]>
…gration into jspecify-mqtt
...-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/ClientManager.java
Show resolved
Hide resolved
Signed-off-by: Jiandong Ma <[email protected]>
Related to: #10083