From 3bd36c65c9dc1dcd008d8b5221ea6350fef734d3 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Mon, 17 Nov 2025 15:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPulsar=E8=AE=BE=E7=BD=AETTL?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=EF=BC=8C=E5=AE=8C=E5=96=84=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9B=B4=E6=96=B0=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../conf/appsettings.Development.json | 1 + DockerComposeShells/docker-compose-init.yml | 1 + DockerComposeShells/docker-compose.yml | 1 + .../configs/appsettings.Production.json | 37 +++++++++++++------ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/DockerComposeShells/adminapi/conf/appsettings.Development.json b/DockerComposeShells/adminapi/conf/appsettings.Development.json index 1a083be..dd98cd6 100644 --- a/DockerComposeShells/adminapi/conf/appsettings.Development.json +++ b/DockerComposeShells/adminapi/conf/appsettings.Development.json @@ -31,6 +31,7 @@ "UserName": "admin", "TenantName": "1YMVZZkAkRArjxSD8457", "Namespace": "OneNET", + "MessageTTL": 3600, "PulsarSecretKey": "0fd7afb8b0d04e6abc4fdfdac2190a79", "PulsarSubscriptionCustomName": "sub", "EnableTls": false, diff --git a/DockerComposeShells/docker-compose-init.yml b/DockerComposeShells/docker-compose-init.yml index 012ea43..03fae12 100644 --- a/DockerComposeShells/docker-compose-init.yml +++ b/DockerComposeShells/docker-compose-init.yml @@ -252,6 +252,7 @@ services: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci - --user=mysql # 确保MySQL以mysql用户运行 + - --binlog-expire-logs-seconds=604800 # 设置binlog保留7天(7*24*60*60=604800秒) deploy: resources: limits: diff --git a/DockerComposeShells/docker-compose.yml b/DockerComposeShells/docker-compose.yml index aac3565..4a8291a 100644 --- a/DockerComposeShells/docker-compose.yml +++ b/DockerComposeShells/docker-compose.yml @@ -204,6 +204,7 @@ services: command: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci + - --binlog-expire-logs-seconds=604800 # 设置binlog保留7天(7*24*60*60=604800秒) deploy: resources: limits: diff --git a/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Production.json b/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Production.json index b93d0b1..175a68b 100644 --- a/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Production.json +++ b/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Production.json @@ -53,18 +53,31 @@ "Pulsar": { "ServiceUrl": "pulsar+ssl://iot-north-mq.heclouds.com:6651", "WebUrl": "http://localhost:8080", - "EnableFilter": true, - "EnableAuthorization": true, - "EnableIoTAuth": true, - "EnableTls": null, - "TlsCertificatePath": null, - "TlsPrivateKeyPath": null, - "ValidateServerCertificate": null, - "NumPartitions": 30, - "TaskThreadCount": 4, - "IoTAccessId": "your_project_access_id", - "IoTSecretKey": "your_project_secret_key", - "IsSubscriber": true + "UserName": "admin", + "TenantName": "1YMVZZkAkRArjxSD8457", + "Namespace": "OneNET", + "MessageTTL": 360, + "PulsarSecretKey": "0fd7afb8b0d04e6abc4fdfdac2190a79", + "PulsarSubscriptionCustomName": "sub4", + "EnableTls": false, + "ValidateServerCertificate": false, + "ConnectionTimeout": 30, + "OperationTimeout": 30, + "KeepAliveInterval": 30, + "TaskThreadCount": 8, + "IsSubscriber": true, + "DefaultPartitions": 16, + "DefaultBundles": 16, + "EnableAutoCreation": true, //开启自动创建Topic + "TopicMode": "Static", //Dynamic 主题模式 + "EnableTopicTypeFilter": true, //允许Topic类型过滤 + "AllowedTopicTypes": [ "Static" ], //允许的Topic类型 + "AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群 + "AdminRoles": [ "admin" ], + "EnableConsumerIdleCleanup": true, + "ConsumerIdleCleanupMinutes": 120, + "EnableProducerIdleCleanup": true, + "ProducerIdleCleanupMinutes": 60 }, "IoTDBOptions": { "UserName": "root",