Commit c0ef747c00658818c8ba32ac3edd23ce8a7bc209
Committed by
Andrew Shvayka
1 parent
23037245
Made RestApiCallNode extendable (for custom rule-nodes)
Showing
3 changed files
with
5 additions
and
3 deletions
... | ... | @@ -58,7 +58,7 @@ import java.util.concurrent.TimeUnit; |
58 | 58 | |
59 | 59 | @Data |
60 | 60 | @Slf4j |
61 | -class TbHttpClient { | |
61 | +public class TbHttpClient { | |
62 | 62 | |
63 | 63 | private static final String STATUS = "status"; |
64 | 64 | private static final String STATUS_CODE = "statusCode"; |
... | ... | @@ -162,7 +162,7 @@ class TbHttpClient { |
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
165 | - void processMessage(TbContext ctx, TbMsg msg) { | |
165 | + public void processMessage(TbContext ctx, TbMsg msg) { | |
166 | 166 | String endpointUrl = TbNodeUtils.processPattern(config.getRestEndpointUrlPattern(), msg.getMetaData()); |
167 | 167 | HttpHeaders headers = prepareHeaders(msg.getMetaData()); |
168 | 168 | HttpMethod method = HttpMethod.valueOf(config.getRequestMethod()); | ... | ... |
... | ... | @@ -46,7 +46,7 @@ import org.thingsboard.server.common.msg.TbMsg; |
46 | 46 | public class TbRestApiCallNode implements TbNode { |
47 | 47 | |
48 | 48 | private boolean useRedisQueueForMsgPersistence; |
49 | - private TbHttpClient httpClient; | |
49 | + protected TbHttpClient httpClient; | |
50 | 50 | |
51 | 51 | @Override |
52 | 52 | public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException { | ... | ... |
... | ... | @@ -15,12 +15,14 @@ |
15 | 15 | */ |
16 | 16 | package org.thingsboard.rule.engine.rest; |
17 | 17 | |
18 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
18 | 19 | import lombok.Data; |
19 | 20 | import org.thingsboard.rule.engine.api.NodeConfiguration; |
20 | 21 | |
21 | 22 | import java.util.Collections; |
22 | 23 | import java.util.Map; |
23 | 24 | |
25 | +@JsonIgnoreProperties(ignoreUnknown = true) | |
24 | 26 | @Data |
25 | 27 | public class TbRestApiCallNodeConfiguration implements NodeConfiguration<TbRestApiCallNodeConfiguration> { |
26 | 28 | ... | ... |