Page 1 of 1

Wie kann ich Fehler bewältigen, wenn ich Daten von Google Pubsub in Apache Camel befragte?

Posted: 20 Feb 2025, 11:08
by Guest
Ich habe ein Camel -Projekt für Umfragedaten aus Google Pubsub Topic entwickelt. Dies ist meine PubSub -Route. < /P>

Code: Select all

from("google-pubsub:xProjectx:xTopicx?maxMessagesPerPoll=20&concurrentConsumers=10&ackMode=AUTO")
.doTry()
.to("direct:someRoute")
.endDoTry()
.doCatch(Exception.class)
.to("direct:errorHandle")
.end();
< /code>
Manchmal erhalte ich diesen Fehler aus PubSub und kann diesen Fehler nicht bewältigen. com.google.api.gax.rpc.DeadlineExceededException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 40.786965000s. [closed=[], open=[[buffered_nanos=362483400, remote_addr=pubsub.googleapis.com/216.58.212.10:443]]]    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:94) ~[gax-2.18.1.jar!/:2.18.1]   at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:41) ~[gax-2.18.1.jar!/:2.18.1]   at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:86) ~[gax-grpc-2.18.1.jar!/:2.18.1]  at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:66) ~[gax-grpc-2.18.1.jar!/:2.18.1]  at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97) ~[gax-grpc-2.18.1.jar!/:2.18.1]   at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:67) ~[api-common-2.2.0.jar!/:na]  at com.google.common.util.concurrent.Futures$4.run(Futures.java:1123) ~[guava-20.0.jar!/:na]    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435) ~[guava-20.0.jar!/:na]    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900) ~[guava-20.0.jar!/:na]     at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811) ~[guava-20.0.jar!/:na]    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:675) ~[guava-20.0.jar!/:na]    at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:572) ~[grpc-stub-1.46.0.jar!/:1.46.0]  at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:542) ~[grpc-stub-1.46.0.jar!/:1.46.0]  at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-api-1.46.0.jar!/:1.46.0]     at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-api-1.46.0.jar!/:1.46.0]   at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-api-1.46.0.jar!/:1.46.0]    at com.google.api.gax.grpc.ChannelPool$ReleasingClientCall$1.onClose(ChannelPool.java:535) ~[gax-grpc-2.18.1.jar!/:2.18.1]  at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562) ~[grpc-core-1.46.0.jar!/:1.46.0]  at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) ~[grpc-core-1.46.0.jar!/:1.46.0]  at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743) ~[grpc-core-1.46.0.jar!/:1.46.0]     at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722) ~[grpc-core-1.46.0.jar!/:1.46.0]    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.46.0.jar!/:1.46.0]   at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.46.0.jar!/:1.46.0]  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]  at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]   at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] Caused by: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 40.786965000s. [closed=[], open=[[buffered_nanos=362483400, remote_addr=pubsub.googleapis.com/216.58.212.10:443]]]    at io.grpc.Status.asRuntimeException(Status.java:535) ~[grpc-api-1.46.0.jar!/:1.46.0]   ... 17 common frames omitted

Ich habe es ausprobiert ** BridgeErrorHandler ** und ** ExceptionHandler ** Parameter, aber nicht funktioniert. Außerdem habe ich einen Onexception -Code -Block ausprobiert, aber ich kann keine Fehler behandeln.