【问题标题】:Timeout using Mule 4 MongoDb connector "list collections" operation使用 Mule 4 MongoDb 连接器“列表集合”操作超时
【发布时间】:2019-09-05 14:39:18
【问题描述】:

我在 Mule 4 中工作。我想连接到 Azure cosmos MongoDB API。我使用 MongoDB 连接器的“插入文档”操作成功保存了文档,但所有其他 MongoDb 操作都引发了异常。以下是我在使用“list collecton”操作时遇到的异常。

Root Exception stack trace:
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=dev-mule-est.documents.azure.com:10255, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]
    at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:182)
    at com.mongodb.internal.connection.AbstractMultiServerCluster.getDescription(AbstractMultiServerCluster.java:54)
    at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:145)
    at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:100)
    at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:277)
    at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:181)
    at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:143)
    at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:92)
    at com.mongodb.client.internal.MappingIterable.iterator(MappingIterable.java:39)
    at com.mongodb.client.internal.MappingIterable.iterator(MappingIterable.java:27)
    at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226)
    at org.mule.modules.mongo.internal.operation.CollectionOperations.listCollections(CollectionOperations.java:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282)
    at org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveMethodComponentExecutor.lambda$execute$1(ReflectiveMethodComponentExecutor.java:80)
    at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:227)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:915)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:879)
    at org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveMethodComponentExecutor.execute(ReflectiveMethodComponentExecutor.java:79)
    at org.mule.runtime.module.extension.internal.runtime.operation.ReflectiveMethodOperationExecutor.execute(ReflectiveMethodOperationExecutor.java:64)
    at org.mule.runtime.module.extension.internal.runtime.execution.InterceptableOperationExecutorWrapper.execute(InterceptableOperationExecutorWrapper.java:60)
    at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$null$3(DefaultExecutionMediator.java:146)
    at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:227)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:915)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:879)
    at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithInterceptors$9(DefaultExecutionMediator.java:146)
    at reactor.core.* (20 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at org.mule.runtime.core.privileged.processor.chain.* (2 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at reactor.core.* (4 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at org.mule.runtime.core.privileged.processor.chain.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at reactor.core.* (11 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:111)
    at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

【问题讨论】:

    标签: mongodb azure-cosmosdb-mongoapi mule-connector


    【解决方案1】:

    这是查询超时。可能查询需要很长时间才能返回。尝试增加socket timeout 或简化/优化查询。

    【讨论】:

    • 是的,我试图增加超时,但问题是别的。
    • 那么很可能是MongoDb方面的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-09
    • 1970-01-01
    • 2015-06-08
    • 1970-01-01
    • 2020-04-28
    • 2020-12-25
    • 1970-01-01
    相关资源
    最近更新 更多