title: Cosmodb reply message length error performing a find using the mongo java driver
body: <p>Using the Mongo Java Driver version 3.4.2
  Trying to perform a find query on a collection that contains around 700 documents has started throwing the following exception.<br>
  This did not happen when the collection was smaller.
  The limits look to be set during the connection process.</p>
  
  <pre><code>! com.mongodb.MongoInternalException: The reply message length 4812632 is less than the maximum message length 4194304
  ! at com.mongodb.connection.ReplyHeader.&lt;init&gt;(ReplyHeader.java:74)
  ! at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:498)
  ! at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224)
  ! at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:96)
  ! at com.mongodb.connection.DefaultConnectionPool$PooledConnection.receiveMessage(DefaultConnectionPool.java:440)
  ! at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:112)
  ! at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168)
  ! at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
  ! at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)
  ! at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)
  ! at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:207)
  ! at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:113)
  ! at com.mongodb.operation.FindOperation$1.call(FindOperation.java:516)
  ! at com.mongodb.operation.FindOperation$1.call(FindOperation.java:510)
  ! at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:431)
  ! at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:404)
  ! at com.mongodb.operation.FindOperation.execute(FindOperation.java:510)
  ! at com.mongodb.operation.FindOperation.execute(FindOperation.java:81)
  ! at com.mongodb.Mongo.execute(Mongo.java:836)
  ! at com.mongodb.Mongo$2.execute(Mongo.java:823)
  ! at com.mongodb.OperationIterable.iterator(OperationIterable.java:47)
  ! at com.mongodb.FindIterableImpl.iterator(FindIterableImpl.java:151)
  </code></pre>