none
Getting Operation timed out when trying to send event to Event Hub using Java client 3.0.0 RRS feed

  • Question

  • Hi Team,

    I am trying to send an event to Event Hub using below code link.

    https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-java-get-started-send.

    Exception

    Exception in thread "main" java.util.concurrent.ExecutionException: com.microsoft.azure.eventhubs.CommunicationException: Operation timed out
    at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
    at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
    at com.newrelic.demo.EventHub.send(EventHub.java:79)
    at com.newrelic.demo.EventHub.main(EventHub.java:25)
    Caused by: com.microsoft.azure.eventhubs.CommunicationException: Operation timed out
    at com.microsoft.azure.eventhubs.impl.ExceptionUtil.toException(ExceptionUtil.java:71)
    at com.microsoft.azure.eventhubs.impl.MessagingFactory.onConnectionError(MessagingFactory.java:367)
    at com.microsoft.azure.eventhubs.impl.ConnectionHandler.onTransportError(ConnectionHandler.java:184)
    at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:191)
    at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
    at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324)
    at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291)
    at com.microsoft.azure.eventhubs.impl.MessagingFactory$RunReactor.run(MessagingFactory.java:620)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
    at java.util.concurrent.FutureTask.run(FutureTask.java)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    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)

    Please do needful.

    Thanks.

    Tuesday, September 10, 2019 6:48 AM

All replies

  • Hello,

    TimeoutException indicates that a user-initiated operation is taking longer than the operation timeout.

    For Event Hubs, the timeout is specified either as part of the connection string, or through ServiceBusConnectionStringBuilder. The error message itself might vary, but it always contains the timeout value specified for the current operation.

    Common causes:

    There are two common causes for this error: incorrect configuration, or a transient service error.

    1. Incorrect configuration: The operation timeout might be too small for the operational condition. The default value for the operation timeout in the client SDK is 60 seconds. Check to see if your code has the value set to something too small. Note that the condition of the network and CPU usage can affect the time it takes for a particular operation to complete, so the operation timeout should not be set to a small value.
    2. Transient service error: Sometimes the Event Hubs service can experience delays in processing requests; for example, during periods of high traffic. In such cases, you can retry your operation after a delay, until the operation is successful. If the same operation still fails after multiple attempts, visit the Azure service status site to see if there are any known service outages.

    For more details, refer “Event Hub Timeout Exception”.

    Hope this helps.      

    ----------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Tuesday, September 10, 2019 9:50 AM
    Moderator
  • I don't know what is issue. I also tried Java script SDK which also throws same exception.

    Thanks.

    Tuesday, September 10, 2019 1:47 PM
  • Hi Orion,

    In order to understand the issue, I would request you to provide the steps which you are trying to send events from Azure Event Hubs along with the complete Java application code?

    Wednesday, September 11, 2019 9:13 AM
    Moderator
  • Hi Orion,

    Just checking in if you have had a chance to see the previous response. We need the above requested information to understand/investigate this issue further.

    Friday, September 13, 2019 9:49 AM
    Moderator