From 856b0259d1ac54e497608814849e201b17377a2a Mon Sep 17 00:00:00 2001 From: Andrii Shvaika Date: Thu, 22 Jul 2021 16:18:39 +0300 Subject: [PATCH] Fix the microservices mode for CoAP --- .../server/transport/coap/client/DefaultCoapClientContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DefaultCoapClientContext.java b/common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DefaultCoapClientContext.java index b444a493d3..3bc53fefe5 100644 --- a/common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DefaultCoapClientContext.java +++ b/common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DefaultCoapClientContext.java @@ -22,6 +22,7 @@ import org.eclipse.californium.core.coap.MediaTypeRegistry; import org.eclipse.californium.core.coap.Response; import org.eclipse.californium.core.observe.ObserveRelation; import org.eclipse.californium.core.server.resources.CoapExchange; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.stereotype.Service; import org.thingsboard.server.coapserver.CoapServerContext; import org.thingsboard.server.coapserver.TbCoapServerComponent; @@ -73,7 +74,7 @@ import static org.eclipse.californium.core.coap.Message.NONE; @Slf4j @Service @RequiredArgsConstructor -@TbCoapServerComponent +@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.coap.enabled}'=='true')") public class DefaultCoapClientContext implements CoapClientContext { private final CoapServerContext config;