forked from dyf/fys-Multi-tenant
设备行为
This commit is contained in:
@ -21,6 +21,7 @@ import org.springframework.messaging.MessageHandler;
|
||||
*/
|
||||
@Configuration
|
||||
public class CustomMqttInboundConfiguration {
|
||||
|
||||
@Autowired
|
||||
private MqttPropertiesConfig mqttPropertiesConfig;
|
||||
@Autowired
|
||||
@ -28,11 +29,13 @@ public class CustomMqttInboundConfiguration {
|
||||
@Autowired
|
||||
private DeviceReceiverMessageHandler deviceReceiverMessageHandler;
|
||||
|
||||
|
||||
@Bean
|
||||
public MessageChannel customMqttChannel(){
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public MessageProducer customMessageProducer(){
|
||||
String clientId = "custom_client_" + UUID.fastUUID();
|
||||
@ -48,9 +51,11 @@ public class CustomMqttInboundConfiguration {
|
||||
return adapter;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
@ServiceActivator(inputChannel = "customMqttChannel")
|
||||
public MessageHandler customMessageHandler(){
|
||||
return deviceReceiverMessageHandler;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user