AWS AMQP + SSL 与 vertx 的连接

AWS AMQP + SSL Connection with vertx

我正在尝试在本地使用 activemQ 连接服务 我正在尝试使用此连接:

fun start(vertx: Vertx, address: String): Single<MQServerConnection> {
    val options: AmqpClientOptions = AmqpClientOptions()
        .setHost("localhost")
        .setPort(5672)
    logger.info("ACTIVE_MQ_PROVIDER_STARTING_IN_THREAD_[" + Thread.currentThread().name + "]")

    return AmqpClient.create(vertx, options).rxConnect().flatMap { amqpConnection ->
        amqpConnection.rxCreateAnonymousSender().flatMap { responseSender ->
            amqpConnection.rxCreateReceiver(address).map { receiver ->
                MQServerConnection(amqpConnection, responseSender, receiver)
            }
        }
    }
}

哪里

data class MQServerConnection(
    val amqpConnection: AmqpConnection,
    val amqpSender: AmqpSender,
    val amqpReceiver: AmqpReceiver
)

而且效果很好。

现在我正在尝试使用 AWS 服务,但 returns 对我来说:

failover:(amqp+ssl://b-4eb4c78c-048b-436c-941e-31250830323e-1.mq.us-east-1.amazonaws.com:5671,amqp+ssl://b-4eb4c78c-048b-436c-941e-31250830323e-2.mq.us-east-1.amazonaws.com:5671)

我不知道如何发送主机而不是本地主机

并安装了端口。

此致

AmqpClientOptions 的 ssl 属性 对于 AMQPS 必须为真,即

val options: AmqpClientOptions = AmqpClientOptions()
    .setHost("b-4eb4c78c-048b-436c-941e-31250830323e-1.mq.us-east-1.amazonaws.com")
    .setPort(5671)
    .setSsl(true)
    .setUsername("admin")
    .setPassword("admin")
    //This is required only if the AWS service uses a self-signed certificate
    .setTrustAll(true)
    //This is required only if the AWS service uses a certificate with a CN that doesn't match the hostname
    .setHostnameVerificationAlgorithm("")