Bläddra i källkod

调整发布

master
杨雷 3 månader sedan
förälder
incheckning
3df03a9550
7 ändrade filer med 50 tillägg och 17 borttagningar
  1. +30
    -0
      .dockerignore
  2. +4
    -7
      TelpoPush.WanJiaAn.Worker/Handlers/KafkaSubscribe.cs
  3. +1
    -1
      TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs
  4. +3
    -1
      TelpoPush.WanJiaAn.Worker/Service/Mq/KafkaService.cs
  5. +1
    -1
      TelpoPush.WanJiaAn.Worker/Worker.cs
  6. +5
    -3
      TelpoPush.WanJiaAn.Worker/appsettings.Development.json
  7. +6
    -4
      TelpoPush.WanJiaAn.Worker/appsettings.production.json

+ 30
- 0
.dockerignore Visa fil

@@ -0,0 +1,30 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**

+ 4
- 7
TelpoPush.WanJiaAn.Worker/Handlers/KafkaSubscribe.cs Visa fil

@@ -25,17 +25,14 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers
public async Task SubscribeAsync()
{
#if DEBUG

_logger.LogInformation("11312");

var temp = new Headers();
string topic = "topic.push.WanJiaAn";
//_logger.LogInformation("11312");
//var temp = new Headers();
//string topic = "topic.push.WanJiaAn";
//temp.Add(new Header("DataType", new byte[] { 0, 0, 0, 0 }));
//temp.Add(new Header("AlarmType", new byte[] { 2, 0, 0, 0 }));
//string psych = "{\"messageId\":\"1790941606816612864\",\"topic\":\"topic.push.third\",\"time\":\"2024-05-16 11:05:27\",\"data\":{\"imei\":\"861281060093147\",\"atteryLowId\":\"861281060093147664577f9\",\"info\":\"设备电量低于15%\"}}";
//await _WanJiaAnProcess.SendWanJiaAn(psych, topic, temp);

//// await _kafkaService.SubscribeAsync(DoReceive, CancellationToken.None);
// await _kafkaService.SubscribeAsync(DoReceive, CancellationToken.None);

#else


+ 1
- 1
TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs Visa fil

@@ -50,7 +50,7 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers
model = JsonConvert.DeserializeObject<BaseModel>(message);
if (model != null)
{
var Jo = JsonConvert.DeserializeObject<Dictionary<string, object>>(model.data.ToString());
var Jo = JsonConvert.DeserializeObject<Dictionary<string, object>>(message);
if (Jo.ContainsKey("device_id"))
imei = Jo["device_id"].ToString();


+ 3
- 1
TelpoPush.WanJiaAn.Worker/Service/Mq/KafkaService.cs Visa fil

@@ -27,10 +27,12 @@ namespace TelpoPush.WanJiaAn.Worker.Service.Mq
// CancellationDelayMaxMs = 1//set CancellationDelayMaxMs
//};



_consumerConfig = new ConsumerConfig
{
BootstrapServers = _configService.KafkaBootstrapServers,
SecurityProtocol = SecurityProtocol.Plaintext,
SecurityProtocol = SecurityProtocol.SaslPlaintext,
SaslMechanism = SaslMechanism.Plain,
GroupId = _configService.KafkaGroupId,
SaslUsername = _configService.KafkaUserName,


+ 1
- 1
TelpoPush.WanJiaAn.Worker/Worker.cs Visa fil

@@ -18,7 +18,7 @@ namespace TelpoPush.WanJiaAn.Worker
while (!stoppingToken.IsCancellationRequested)
{
await _kafkaSubscribe.SubscribeAsync();
await Task.Delay(1000, stoppingToken);
await Task.Delay(1000000, stoppingToken);
}
}
}


+ 5
- 3
TelpoPush.WanJiaAn.Worker/appsettings.Development.json Visa fil

@@ -19,9 +19,11 @@
},
"ServiceConfig": {
"TelpoDataUrl": "http://id.ssjlai.com/data",
"KafkaBootstrapServers": "47.116.67.214:9092", // "172.19.42.53:9092",
"KafkaTopics": [ "topic.push.WanJiaAn" ],
"KafkaGroupId": "telpo.WanJiaAn",
"KafkaBootstrapServers": "139.196.106.140:9092", // "172.19.42.53:9092",
"KafkaTopics": [ "topic.wanjiaan.push.telpo" ],
"KafkaGroupId": "telpo.wanjiaan",
"KafkaUserName": "wanjiaan",
"KafkaPassword": "wanjiaan@telpo#123",
"CacheDurationSeconds": 1200, //20分钟
"CacheDurationSeconds10": 600 //10分钟
},


+ 6
- 4
TelpoPush.WanJiaAn.Worker/appsettings.production.json Visa fil

@@ -15,10 +15,12 @@
"RzlVoiceCallback": "http://121.40.140.74/GspCardStand/api/Voice/VoiceCallback"
},
"ServiceConfig": {
"TelpoDataUrl": "https://ai.ssjlai.com/data",
"KafkaBootstrapServers": "172.19.42.40:9092,172.19.42.41:9092,172.19.42.48:9092",
"KafkaTopics": [ "topic.push.WanJiaAn" ],
"KafkaGroupId": "telpo.WanJiaAn",
"TelpoDataUrl": "http://id.ssjlai.com/data",
"KafkaBootstrapServers": "139.196.106.140:9092", // "172.19.42.53:9092",
"KafkaTopics": [ "topic.wanjiaan.push.telpo" ],
"KafkaGroupId": "telpo.wanjiaan",
"KafkaUserName": "wanjiaan",
"KafkaPassword": "wanjiaan@telpo#123",
"CacheDurationSeconds": 1200, //20分钟
"CacheDurationSeconds10": 600 //10分钟
},


Laddar…
Avbryt
Spara