@@ -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/** |
@@ -25,17 +25,14 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers | |||||
public async Task SubscribeAsync() | public async Task SubscribeAsync() | ||||
{ | { | ||||
#if DEBUG | #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("DataType", new byte[] { 0, 0, 0, 0 })); | ||||
//temp.Add(new Header("AlarmType", new byte[] { 2, 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%\"}}"; | //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 _WanJiaAnProcess.SendWanJiaAn(psych, topic, temp); | ||||
//// await _kafkaService.SubscribeAsync(DoReceive, CancellationToken.None); | |||||
// await _kafkaService.SubscribeAsync(DoReceive, CancellationToken.None); | |||||
#else | #else | ||||
@@ -50,7 +50,7 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers | |||||
model = JsonConvert.DeserializeObject<BaseModel>(message); | model = JsonConvert.DeserializeObject<BaseModel>(message); | ||||
if (model != null) | 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")) | if (Jo.ContainsKey("device_id")) | ||||
imei = Jo["device_id"].ToString(); | imei = Jo["device_id"].ToString(); | ||||
@@ -27,10 +27,12 @@ namespace TelpoPush.WanJiaAn.Worker.Service.Mq | |||||
// CancellationDelayMaxMs = 1//set CancellationDelayMaxMs | // CancellationDelayMaxMs = 1//set CancellationDelayMaxMs | ||||
//}; | //}; | ||||
_consumerConfig = new ConsumerConfig | _consumerConfig = new ConsumerConfig | ||||
{ | { | ||||
BootstrapServers = _configService.KafkaBootstrapServers, | BootstrapServers = _configService.KafkaBootstrapServers, | ||||
SecurityProtocol = SecurityProtocol.Plaintext, | |||||
SecurityProtocol = SecurityProtocol.SaslPlaintext, | |||||
SaslMechanism = SaslMechanism.Plain, | SaslMechanism = SaslMechanism.Plain, | ||||
GroupId = _configService.KafkaGroupId, | GroupId = _configService.KafkaGroupId, | ||||
SaslUsername = _configService.KafkaUserName, | SaslUsername = _configService.KafkaUserName, | ||||
@@ -18,7 +18,7 @@ namespace TelpoPush.WanJiaAn.Worker | |||||
while (!stoppingToken.IsCancellationRequested) | while (!stoppingToken.IsCancellationRequested) | ||||
{ | { | ||||
await _kafkaSubscribe.SubscribeAsync(); | await _kafkaSubscribe.SubscribeAsync(); | ||||
await Task.Delay(1000, stoppingToken); | |||||
await Task.Delay(1000000, stoppingToken); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -19,9 +19,11 @@ | |||||
}, | }, | ||||
"ServiceConfig": { | "ServiceConfig": { | ||||
"TelpoDataUrl": "http://id.ssjlai.com/data", | "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分钟 | "CacheDurationSeconds": 1200, //20分钟 | ||||
"CacheDurationSeconds10": 600 //10分钟 | "CacheDurationSeconds10": 600 //10分钟 | ||||
}, | }, | ||||
@@ -15,10 +15,12 @@ | |||||
"RzlVoiceCallback": "http://121.40.140.74/GspCardStand/api/Voice/VoiceCallback" | "RzlVoiceCallback": "http://121.40.140.74/GspCardStand/api/Voice/VoiceCallback" | ||||
}, | }, | ||||
"ServiceConfig": { | "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分钟 | "CacheDurationSeconds": 1200, //20分钟 | ||||
"CacheDurationSeconds10": 600 //10分钟 | "CacheDurationSeconds10": 600 //10分钟 | ||||
}, | }, | ||||