简体   繁体   English

在春季启动时无法使用kafka连接到组成mongodb

[英]cannot connect to compose mongodb with kafka on spring boot

I'm running a spring boot app that listens to IBM Message Hub Kafka and then stores into compose for mongoDB on IBM Cloud. 我正在运行一个Spring Boot应用程序,该应用程序侦听IBM Message Hub Kafka,然后存储到IBM Cloud上的mongoDB的compose中。

I'm getting an error related to SSL certificate when I run Kafka and Compose for MongoDB together. 当我同时运行Kafka和Compose for MongoDB时,出现与SSL证书相关的错误。

I am using compose for mongodb certificate and with a valid trust store and key. 我为mongodb证书使用了compose,并使用了有效的信任库和密钥。

If I use embedded mongo in spring boot, then all is fine. 如果我在春季启动时使用嵌入式mongo,那么一切都很好。

Things I've setup so far: 到目前为止,我已设置的内容:

I set up my compose for mongodb URI in my application properties file I passed in the trust store and the key password as VM arguments with running the java application. 我在运行信任关系的应用程序属性文件中设置了mongodb URI的撰写,并通过运行Java应用程序将密钥密码作为VM参数设置为VM。

Error: com.mongodb.MongoSocketWriteException: Exception sending message at com.mongodb.connection.InternalStreamConnection.translateWriteException(InternalStreamConnection.java:518) ~[mongodb-driver-core-3.6.3.jar:na] 错误: com.mongodb.MongoSocketWriteException:com.mongodb.connection.InternalStreamConnection.translateWriteException(InternalStreamConnection.java:518)〜[mongodb-driver-core-3.6.3.jar:na]发送消息异常

确保在您的jar后面传递信任库和密码,例如java -jar -Djavax.net.ssl.trustStore = JKS_HERE -Djavax.net.ssl.trustStorePassword = PASS_HERE target / jarfilehere.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM