Commit d375eca8 authored by 周昊's avatar 周昊

1、修改日志输出

parent 3a2778fd
......@@ -52,7 +52,7 @@ public class StreamingJob {
//3、4 Object -> String
streamOperator = streamOperator.map(algorithmPushDto ->{
System.out.println(algorithmPushDto);
System.out.println(algorithmPushDto.toString());
return algorithmPushDto;
});
......@@ -78,7 +78,7 @@ public class StreamingJob {
SingleOutputStreamOperator<String> outputStreamOperator = streamOperator.map(AlgorithmPushDto::toString);
//3、5 输出kafka
// outputStreamOperator.addSink(new FlinkKafkaProducer("192.168.10.137: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