|
|
|
@ -15,7 +15,7 @@ import java.util.Properties; |
|
|
|
|
|
|
|
public class RootCloudIotDataEventSourceMocker { |
|
|
|
// 延迟:毫秒 |
|
|
|
public static final long DELAY = 1000; |
|
|
|
public static final long DELAY = 3000; |
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception { |
|
|
|
// 创建kafka配置属性 |
|
|
|
@ -75,6 +75,9 @@ public class RootCloudIotDataEventSourceMocker { |
|
|
|
|
|
|
|
private static Properties createKafkaProperties() { |
|
|
|
Properties kafkaProps = new Properties(); |
|
|
|
// 测试环境 |
|
|
|
//kafkaProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "120.25.199.30:19092"); |
|
|
|
// 正式环境 |
|
|
|
kafkaProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "120.25.199.30:19092"); |
|
|
|
kafkaProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getCanonicalName()); |
|
|
|
kafkaProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getCanonicalName()); |
|
|
|
|