Git Product home page Git Product logo

Comments (9)

lyonsmg avatar lyonsmg commented on July 17, 2024

http://stackoverflow.com/questions/42563043/azure-event-hub-servicebusexception-causing-skipped-messages

from azure-event-hubs-java.

JamesBirdsall avatar JamesBirdsall commented on July 17, 2024

This looks a lot like issue 132 in the dotnet version Azure/azure-event-hubs-dotnet#132 . We are in the process of porting the fix to Java EPH.

from azure-event-hubs-java.

JamesBirdsall avatar JamesBirdsall commented on July 17, 2024

Unfortunately this is not the same as the dotnet issue 132. Continuing to investigate.

from azure-event-hubs-java.

JamesBirdsall avatar JamesBirdsall commented on July 17, 2024

Some questions:

  1. The exceptions shown above were reported to the onError method of the customer’s IEventProcessor implementation, right? If not, where were they caught?
  2. Are you using checkpoints? If so, when do you create checkpoints? If not, what initial offset provider do you set up in EventProcessorOptions? Exceptions like these will cause the existing IEventProcessor instance for that partition to shut down, and then it will be restarted, possibly on another EventProcessorHost instance if there are multiple. There’s a potential to skip messages during such a shutdown and restart if the starting point for the new receiver is not carefully chosen.

Thanks!

from azure-event-hubs-java.

lyonsmg avatar lyonsmg commented on July 17, 2024

from azure-event-hubs-java.

nirmalpshah avatar nirmalpshah commented on July 17, 2024

@JamesBirdsall answers to your questions:

  1. You're correct, these exceptions were reported to the onError method of our IEventProcessor - I had missed them in the noise of the log.
  2. We are using checkpoints. We call context.checkpoint() in the last line of our onEvents method. We are also, as one of the first lines of our onEvents method, calling context.setOffsetAndSequenceNumber() with details of the latest event provided in onEvents.

I see now that setOffsetAndSequenceNumber is deprecated. What is the recommended way to checkpoint to avoid the data loss you describe?

from azure-event-hubs-java.

JamesBirdsall avatar JamesBirdsall commented on July 17, 2024

Sreeram has identified the origin of this issue and his fix is pull request 78, linked above. My initial suspicion of a checkpointing problem was not correct.

The checkpointing recommendation is pretty straightforward: don't checkpoint until you're absolutely sure that you have either processed all events up to and including the checkpointed offset, or that you don't care if some haven't been. Depending on the nature of the processing, implementing that recommendation correctly can be simple or complicated, such as if the processing is async, or worse yet if it appears to be synchronous but is actually doing async under the covers, like a lazy or batched write/commit.

As far as checkpointing with a specific offset, the recommended way is PartitionContext.checkpoint(EventData), which checkpoints the offset and sequence number of the event given as the argument.

from azure-event-hubs-java.

SreeramGarlapati avatar SreeramGarlapati commented on July 17, 2024

@lyonsmg - this bug was fixed as part of our release http://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs/0.12.0
We truly appreciate you for filing the issue and the patience with which you lead this bug to a resolution. Thanks a lot!
Sreeram

from azure-event-hubs-java.

madhunaidu2468 avatar madhunaidu2468 commented on July 17, 2024

Hi @SreeramGarlapati ,

I am still facing this issue in azure-eventhubs (version 0.13.0). Could you please let me know if I need to make any changes in code. I have 4 partitions and 2 of my partitions stopped suddenly, so I was not receiving events sent from device.

My code is same as the tutorial in this link

Error message I receive is:
2017-08-09 23:46:03 - IN: CH[1] : Detach{handle=0, closed=true, error=Error{condition=com.microsoft:container-close, description='The message container is being closed (20074). TrackingId:30a8f397-7843-41a5-aae3-ac2bbe25a0d6_B5, SystemTracker:NoSystemTracker, Timestamp:8/9/2017 11:46:03 PM', info=null}}
2017-08-09 23:46:03 - linkName[76e5b7_e0fb_G5_1502316395138], ErrorCondition[com.microsoft:container-close, The message container is being closed (20074). TrackingId:30a8f397-7843-41a5-aae3-ac2bbe25a0d6_B5, SystemTracker:NoSystemTracker, Timestamp:8/9/2017 11:46:03 PM]
2017-08-09 23:46:03 - linkName[76e5b7_e0fb_G5_1502316395138]

from azure-event-hubs-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.