Spring boot AWS IoT MQTT客户端与Apache camel MQTT

Spring boot AWS IoT MQTT客户端与Apache camel MQTT,spring-boot,apache-camel,mqtt,aws-iot,spring-integration-mqtt,Spring Boot,Apache Camel,Mqtt,Aws Iot,Spring Integration Mqtt,我正在考虑使用ApacheCamel(使用Camel mqtt)+Spring引导构建AWS IoT Java客户机。对我来说,这听起来很匹配,但找不到任何例子。有什么缺点我看不出来吗?我想看看有没有什么提示 我用下面的配置使它工作。SSLContextbean持有证书/安全性: @Bean RouteBuilder awsIoTRoute() { return new RouteBuilder() { @Override

我正在考虑使用ApacheCamel(使用Camel mqtt)+Spring引导构建AWS IoT Java客户机。对我来说,这听起来很匹配,但找不到任何例子。有什么缺点我看不出来吗?我想看看有没有什么提示

我用下面的配置使它工作。SSLContextbean持有证书/安全性:

    @Bean
    RouteBuilder awsIoTRoute() {

        return new RouteBuilder() {

            @Override
            public void configure() throws Exception {

                from("timer://foo?repeatCount=0&delay=5000&fixedRate=true&period=17s")
                    .setBody(simple("TEST MESSAGE"))
                    .to("mqtt:awsIoTPublisher?host=ssl://{{aws.iot.host}}:8883&publishTopicName={{aws.iot.pub.topic}}&clientId={{aws.iot.pub.clientId}}&sslContext=#sslContext")
                    .log("Sent :"+body().convertToString().toString());

                from("mqtt:awsIoTReciever?host=ssl://{{aws.iot.host}}:8883&subscribeTopicName={{aws.iot.sub.topic}}&clientId={{aws.iot.sub.clientId}}&sslContext=#sslContext").log("Recieved : "+body().convertToString());


            }
        };
    }

您还可以考虑使用camel-paho,因为Eclipse-paho比camel-MQTT使用的MQTT客户机更易于维护。例如,你可以看看物联网博客。一些人已经展示了如何使用Camel、MQTT和IoT设备实现这一点。谢谢@ClausIbsen,你知道骆驼泛美卫生组织用来连接AWS物联网的好例子吗?我似乎找不到任何可靠的示例。如何配置sslContext?