Vertx에서 MongoDB Atlas 데이터베이스를 서비스 (https://www.mongodb.com)로 사용하려 했습니까?Vertx에서 MongoDB Atlas 사용
나는 연결을 시도했지만 나는 다음과 같은 오류가 계속 :
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mongo-client</artifactId>
<version>3.5.0</version>
</dependency>
내가 그들의 자바 몽고 드라이버를 사용하려고보다 :
을INFO: Exception in monitor thread while connecting to server socie-shard-00-01-zeymc.mongodb.net:27017
com.mongodb.MongoSocketReadException: Prematurely reached end of stream
at com.mongodb.connection.AsynchronousSocketChannelStream$BasicCompletionHandler.completed(AsynchronousSocketChannelStream.java:215)
at com.mongodb.connection.AsynchronousSocketChannelStream$BasicCompletionHandler.completed(AsynchronousSocketChannelStream.java:201)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:281)
at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.completed(WindowsAsynchronousSocketChannelImpl.java:579)
at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:397)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
나는 다음을 사용
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.6.0</version>
</dependency>
이것은 작동합니다. 이것만으로도 모든 쿼리에서 큰 재 작성이 필요합니다. Vertx와 함께 좋은 드라이버인지 확실하지 않습니다.
위의 오류를 해결하는 방법을 아는 사람이 누구인지 또는 누구든지 org.mongodb java 드라이버를 사용하는 것이 안전한 지 알고 있습니다.
미리 감사드립니다. 다니엘에
내 솔루션
덕분에, 나는 그것이 vertx - 몽고 클라이언트 작업 얻을 관리!
내 JSON의 설정
config.put("ssl", true);
에 추가 그리고 나는 MongoClient를 작성하기 전에 다음 줄을 추가했다.
System.setProperty("org.mongodb.async.type", "netty");
서비스 제공 업체로서의 데이터베이스에 대한 최소 드라이버 요구 사항을 확인 했습니까? vertx-mongo-client는 기본적으로 3.4.1과 함께 제공됩니다. 3.5.0에서는 작동하지만 아직 3.6.0에서는 작동하지 않습니다 (GitHub의 [# 108] (https://github.com/vert-x3/vertx-mongo-client/issues/108) 참조). – tsegismont
두 개가 있습니다 (3.6과 3.4). 3.4 데이터베이스를 사용 중입니다 –
문제와 해결책을 추적 할 수 있도록 GitHub에 문제를 제기 하시겠습니까? 고마워요 https://github.com/vert-x3/vertx-mongo-client/issues/new – tsegismont