Reverted constant metadata, refactored update for device session context and metadata creation
This commit is contained in:
		
							parent
							
								
									ababd11a5d
								
							
						
					
					
						commit
						45abd22b72
					
				@ -137,7 +137,6 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
 | 
			
		||||
    private static final MqttQoS MAX_SUPPORTED_QOS_LVL = AT_LEAST_ONCE;
 | 
			
		||||
 | 
			
		||||
    private final UUID sessionId;
 | 
			
		||||
    private final TbMsgMetaData msgMetaData = new TbMsgMetaData();
 | 
			
		||||
 | 
			
		||||
    protected final MqttTransportContext context;
 | 
			
		||||
    private final TransportService transportService;
 | 
			
		||||
@ -538,9 +537,12 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
 | 
			
		||||
 | 
			
		||||
    private TbMsgMetaData getMetadata(DeviceSessionCtx ctx, String topicName) {
 | 
			
		||||
        if (ctx.isDeviceProfileMqttTransportType()) {
 | 
			
		||||
            msgMetaData.putValue(DataConstants.MQTT_TOPIC, topicName);
 | 
			
		||||
            TbMsgMetaData md = new TbMsgMetaData();
 | 
			
		||||
            md.putValue(DataConstants.MQTT_TOPIC, topicName);
 | 
			
		||||
            return md;
 | 
			
		||||
        } else {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        return msgMetaData;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void sendAckOrCloseSession(ChannelHandlerContext ctx, String topicName, int msgId) {
 | 
			
		||||
 | 
			
		||||
@ -184,6 +184,7 @@ public class DeviceSessionCtx extends MqttDeviceAwareSessionContext {
 | 
			
		||||
            telemetryTopicFilter = MqttTopicFilterFactory.getDefaultTelemetryFilter();
 | 
			
		||||
            attributesPublishTopicFilter = MqttTopicFilterFactory.getDefaultAttributesFilter();
 | 
			
		||||
            payloadType = TransportPayloadType.JSON;
 | 
			
		||||
            deviceProfileMqttTransportType = false;
 | 
			
		||||
            sendAckOnValidationException = false;
 | 
			
		||||
        }
 | 
			
		||||
        updateAdaptor();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user