Commit 698ffc92 authored by 周昊's avatar 周昊

Merge branch 'master' into production

# Conflicts:
#	src/main/java/com/censoft/flink/StreamingJob.java
parents e647376d d375eca8
......@@ -54,7 +54,7 @@ public class StreamingJob {
//3、4 Object -> String
streamOperator = streamOperator.map(algorithmPushDto ->{
System.out.println(algorithmPushDto);
System.out.println(algorithmPushDto.toString());
return algorithmPushDto;
});
......@@ -80,7 +80,7 @@ public class StreamingJob {
SingleOutputStreamOperator<String> outputStreamOperator = streamOperator.map(AlgorithmPushDto::toString);
//3、5 输出kafka
outputStreamOperator.addSink(new FlinkKafkaProducer("172.16.33.152:9092", "test-topic", new SimpleStringSchema()));
// outputStreamOperator.addSink(new FlinkKafkaProducer("172.16.33.152:9092", "test-topic", new SimpleStringSchema()));
//3、6 打印输出
outputStreamOperator.print();
......
......@@ -104,6 +104,7 @@ public class MqttConsumer extends RichParallelSourceFunction<AlgorithmPushDto> {
public void messageArrived(String s, MqttMessage message) throws Exception {
//订阅消息字符
String msg = new String(message.getPayload());
System.out.println(msg);
byte[] bymsg = getBytesFromObject(msg);
AlgorithmPushDto algorithmPushDto = JSON.parseObject(msg, AlgorithmPushDto.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment