是否有可能从下面的代码中获取订阅有效载荷数据

时间:2019-06-26 18:31:42

标签: java amazon-web-services sdk

我正在尝试从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();

0 个答案:

没有答案