Merge branch 'master' of https://gitea.qinmian.online/a_bazu/cloud-server-8
commit
5a64054615
|
@ -23,5 +23,11 @@
|
||||||
<artifactId>kafka-clients</artifactId>
|
<artifactId>kafka-clients</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 项目公共核心 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -89,7 +89,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-kafka</artifactId>
|
<artifactId>cloud-common-kafka</artifactId>
|
||||||
<version>3.6.3</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.iotdb</groupId>
|
<groupId>org.apache.iotdb</groupId>
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.muyu.server.mqtt;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import com.muyu.common.kafka.constants.KafkaConstants;
|
|
||||||
import com.muyu.domain.CarMessage;
|
import com.muyu.domain.CarMessage;
|
||||||
import com.muyu.server.service.CarMessageService;
|
import com.muyu.server.service.CarMessageService;
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
@ -83,7 +82,7 @@ public class Demo {
|
||||||
results[i] = futures.get(i).get();
|
results[i] = futures.get(i).get();
|
||||||
}
|
}
|
||||||
String jsonString = JSONObject.toJSONString( results );
|
String jsonString = JSONObject.toJSONString( results );
|
||||||
ProducerRecord<String, String> producerRecord = new ProducerRecord<>( KafkaConstants.KafkaTopic, jsonString);
|
ProducerRecord<String, String> producerRecord = new ProducerRecord<>( "carJsons", jsonString);
|
||||||
kafkaProducer.send(producerRecord);
|
kafkaProducer.send(producerRecord);
|
||||||
}
|
}
|
||||||
// 接收信息
|
// 接收信息
|
||||||
|
|
8
pom.xml
8
pom.xml
|
@ -42,6 +42,7 @@
|
||||||
<hutool.version>5.8.27</hutool.version>
|
<hutool.version>5.8.27</hutool.version>
|
||||||
<knife4j-openapi3.version>4.1.0</knife4j-openapi3.version>
|
<knife4j-openapi3.version>4.1.0</knife4j-openapi3.version>
|
||||||
<xxl-job-core.version>2.4.1</xxl-job-core.version>
|
<xxl-job-core.version>2.4.1</xxl-job-core.version>
|
||||||
|
<kafka.version>3.6.3</kafka.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
|
@ -218,6 +219,13 @@
|
||||||
<version>${muyu.version}</version>
|
<version>${muyu.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--kafka-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-kafka</artifactId>
|
||||||
|
<version>${kafka.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 分布式事务 -->
|
<!-- 分布式事务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
|
|
Loading…
Reference in New Issue