我正在尝试从java sdk iot核心获取订阅有效载荷数据,但是我对aws sdk的了解却很少。...
CommandArguments arguments = CommandArguments.parse(args);
initClient(arguments);
awsIotClient.connect();
AWSIotTopic topic = new TestTopicListener(TestTopic, TestTopicQos);
awsIotClient.subscribe(topic, true);
// System.out.println(topic.onMessage(message));
awsIotClient.publish(TestTopic, "Test");
Thread blockingPublishThread = new Thread(new BlockingPublisher(awsIotClient));
Thread nonBlockingPublishThread = new Thread(new NonBlockingPublisher(awsIotClient));
blockingPublishThread.start();
nonBlockingPublishThread.start();
blockingPublishThread.join();
nonBlockingPublishThread.join();