Browse Source
# Conflicts: # application/src/main/data/upgrade/basic/schema_update.sql # rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/rest/TbHttpClient.java # rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/rest/TbRestApiCallNode.java # rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/rest/TbHttpClientTest.java # rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/rest/TbRestApiCallNodeTest.javapull/15445/head
13 changed files with 754 additions and 46 deletions
@ -0,0 +1,25 @@ |
|||||
|
-- |
||||
|
-- Copyright © 2016-2026 The Thingsboard Authors |
||||
|
-- |
||||
|
-- Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
-- you may not use this file except in compliance with the License. |
||||
|
-- You may obtain a copy of the License at |
||||
|
-- |
||||
|
-- http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
-- |
||||
|
-- Unless required by applicable law or agreed to in writing, software |
||||
|
-- distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
-- See the License for the specific language governing permissions and |
||||
|
-- limitations under the License. |
||||
|
-- |
||||
|
|
||||
|
-- LTS cumulative schema update file. |
||||
|
-- All statements must be idempotent (use IF NOT EXISTS, ADD COLUMN IF NOT EXISTS, DO $$ ... END $$ guards, etc.). |
||||
|
-- This file is executed by SystemPatchApplier on every version increase within the LTS family. |
||||
|
|
||||
|
-- CALCULATED FIELD ADDITIONAL INFO ADDITION START |
||||
|
|
||||
|
ALTER TABLE calculated_field ADD COLUMN IF NOT EXISTS additional_info varchar; |
||||
|
|
||||
|
-- CALCULATED FIELD ADDITIONAL INFO ADDITION END |
||||
@ -0,0 +1,51 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2026 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
package org.thingsboard.server.config; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.thingsboard.rule.engine.api.TbHttpClientSettings; |
||||
|
import org.thingsboard.server.queue.util.TbRuleEngineComponent; |
||||
|
|
||||
|
@TbRuleEngineComponent |
||||
|
@Component |
||||
|
public class TbHttpClientSettingsComponent implements TbHttpClientSettings { |
||||
|
|
||||
|
@Value("${actors.rule.external.http_client.max_parallel_requests:0}") |
||||
|
private int maxParallelRequests; |
||||
|
|
||||
|
@Value("${actors.rule.external.http_client.max_pending_requests:0}") |
||||
|
private int maxPendingRequests; |
||||
|
|
||||
|
@Value("${actors.rule.external.http_client.pool_max_connections:0}") |
||||
|
private int poolMaxConnections; |
||||
|
|
||||
|
@Override |
||||
|
public int getMaxParallelRequests() { |
||||
|
return maxParallelRequests; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int getMaxPendingRequests() { |
||||
|
return maxPendingRequests; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int getPoolMaxConnections() { |
||||
|
return poolMaxConnections; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2026 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
package org.thingsboard.rule.engine.api; |
||||
|
|
||||
|
/** |
||||
|
* Server-level safety caps for the HTTP client used by the REST API Call rule node. |
||||
|
* Values are read from {@code thingsboard.yml} (or the corresponding environment variables) |
||||
|
* and applied as hard ceilings on top of the per-node tenant configuration. |
||||
|
* A value of {@code 0} means no system-level restriction. |
||||
|
*/ |
||||
|
public interface TbHttpClientSettings { |
||||
|
|
||||
|
/** System ceiling for {@code maxParallelRequestsCount}. 0 = no system limit. */ |
||||
|
int getMaxParallelRequests(); |
||||
|
|
||||
|
/** System ceiling for the pending-request queue depth. 0 = no system limit. */ |
||||
|
int getMaxPendingRequests(); |
||||
|
|
||||
|
/** |
||||
|
* Maximum number of TCP connections in the reactor-netty pool per node instance. |
||||
|
* 0 = use reactor-netty's default: {@code max(availableProcessors, 8) * 2}. |
||||
|
*/ |
||||
|
int getPoolMaxConnections(); |
||||
|
|
||||
|
TbHttpClientSettings DEFAULT = new TbHttpClientSettings() { |
||||
|
@Override |
||||
|
public int getMaxParallelRequests() { return 0; } |
||||
|
|
||||
|
@Override |
||||
|
public int getMaxPendingRequests() { return 0; } |
||||
|
|
||||
|
@Override |
||||
|
public int getPoolMaxConnections() { return 0; } |
||||
|
}; |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue