Skip to content

Commit

Permalink
Som code improvements in the MqttSupplierConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Dec 19, 2024
1 parent 6d4cb43 commit 85a33ea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*
* @author Janne Valkealahti
* @author Soby Chacko
* @author Artem Bilan
*/
@EnableConfigurationProperties(MqttSupplierProperties.class)
@AutoConfiguration(after = MqttConfiguration.class)
Expand All @@ -58,7 +59,6 @@ public MqttPahoMessageDrivenChannelAdapter mqttInbound(MqttSupplierProperties pr
mqttClientFactory, properties.getTopics());
adapter.setQos(properties.getQos());
adapter.setConverter(pahoMessageConverter(properties, beanFactory));
adapter.setAutoStartup(false);

if (mqttMessageProducerCustomizer != null) {
mqttMessageProducerCustomizer.customize(adapter);
Expand All @@ -72,8 +72,9 @@ public Publisher<Message<byte[]>> mqttPublisher(MqttPahoMessageDrivenChannelAdap
return IntegrationFlow.from(mqttInbound).toReactivePublisher(true);
}

private DefaultPahoMessageConverter pahoMessageConverter(MqttSupplierProperties properties,
private static DefaultPahoMessageConverter pahoMessageConverter(MqttSupplierProperties properties,
BeanFactory beanFactory) {

DefaultPahoMessageConverter converter = new DefaultPahoMessageConverter(properties.getCharset());
converter.setPayloadAsBytes(properties.isBinary());
converter.setBeanFactory(beanFactory);
Expand Down

0 comments on commit 85a33ea

Please sign in to comment.