fixed license, env name refactoring
This commit is contained in:
parent
f26d827ab8
commit
1be39aa9aa
@ -1,3 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Copyright © 2016-2023 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.service.executors;
|
package org.thingsboard.server.service.executors;
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -5,6 +20,7 @@ import org.thingsboard.common.util.ExecutorProvider;
|
|||||||
import org.thingsboard.common.util.ThingsBoardThreadFactory;
|
import org.thingsboard.common.util.ThingsBoardThreadFactory;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
@ -26,4 +42,11 @@ public class PubSubRuleNodeExecutorProvider implements ExecutorProvider {
|
|||||||
public ScheduledExecutorService getExecutor() {
|
public ScheduledExecutorService getExecutor() {
|
||||||
return executor;
|
return executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
private void destroy() {
|
||||||
|
if (executor != null) {
|
||||||
|
executor.shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1412,7 +1412,7 @@ queue:
|
|||||||
# Number of messages per consumer
|
# Number of messages per consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
||||||
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
@ -1,3 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Copyright © 2016-2023 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.queue.pubsub;
|
package org.thingsboard.server.queue.pubsub;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@ -7,6 +22,7 @@ import org.thingsboard.common.util.ExecutorProvider;
|
|||||||
import org.thingsboard.common.util.ThingsBoardThreadFactory;
|
import org.thingsboard.common.util.ThingsBoardThreadFactory;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
@ -34,4 +50,11 @@ public class TbPubSubQueueExecutorProvider implements ExecutorProvider {
|
|||||||
public ScheduledExecutorService getExecutor() {
|
public ScheduledExecutorService getExecutor() {
|
||||||
return executor;
|
return executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
private void destroy() {
|
||||||
|
if (executor != null) {
|
||||||
|
executor.shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Copyright © 2016-2023 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.common.util;
|
package org.thingsboard.common.util;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|||||||
@ -173,7 +173,7 @@ queue:
|
|||||||
# Number of messages per consumer
|
# Number of messages per consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Core subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
# Pub/Sub properties for Core subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
||||||
core: "${TB_QUEUE_PUBSUB_CORE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
core: "${TB_QUEUE_PUBSUB_CORE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
@ -296,7 +296,7 @@ queue:
|
|||||||
# Number of messages per consumer
|
# Number of messages per consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
||||||
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
@ -279,7 +279,7 @@ queue:
|
|||||||
# Number of messages per a consumer
|
# Number of messages per a consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consume again
|
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consume again
|
||||||
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
@ -375,7 +375,7 @@ queue:
|
|||||||
# Number of messages per consumer
|
# Number of messages per consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
||||||
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
@ -312,7 +312,7 @@ queue:
|
|||||||
# Number of messages per consumer
|
# Number of messages per consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
||||||
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
@ -265,7 +265,7 @@ queue:
|
|||||||
# Number of messages per consumer
|
# Number of messages per consumer
|
||||||
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
|
||||||
# Number of threads of pubsub executor provider
|
# Number of threads of pubsub executor provider
|
||||||
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_SIZE:}"
|
executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:}"
|
||||||
queue-properties:
|
queue-properties:
|
||||||
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
|
||||||
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user