Coder Social home page Coder Social logo

Comments (8)

basert avatar basert commented on August 17, 2024 1

I was able to reproduce this issue by noticing that after the connection was restored by lyra, two consumers were on my queue. One was with this initial consumer tag, the other was with a new one.

I did some breakpoint debugging on the basicConsume method in com.rabbitmq.client.impl.ChannelN and the method gets called twice after the connection restore. This is due to changed behavior in rabbitmq > 4.0.0 where automatic recovery is enabled by default, resulting in a new consumer from lyra and the recovered by the rabbitmq library.

My solution was to disable this in the connection factory:

val connectionFactory = new com.rabbitmq.client.ConnectionFactory
connectionFactory.setAutomaticRecoveryEnabled(false)
val options = new ConnectionOptions(connectionFactory)

from lyra.

basert avatar basert commented on August 17, 2024 1

added a PR, not sure how to release a new version though, I think that is up to you :)

from lyra.

EdeMeijer avatar EdeMeijer commented on August 17, 2024

Hello,

Just wanted to ping you to check if you maybe have time to get back to me on this :)

Kind regards.

from lyra.

michaelklishin avatar michaelklishin commented on August 17, 2024

@EdeMeijer I doubt this has anything to do with Lyra. You are not specifying how exactly you are publishing messages but it sounds like a routing problem and not a recovery one. See Message Tracing and how to capture traffic with Wireshark.

Also consider posting questions to rabbitmq-users and providing the entire server log.

from lyra.

michaelklishin avatar michaelklishin commented on August 17, 2024

Also consider handling exceptions in your consumer's methods. While reasonably recent RabbitMQ Java client versions log unhandled exceptions and provide both forgiving and strict consumer implementations (the strict one closes channel upon an unhandled exception), it is much easier to inspect any possible exceptions if you handle them in your own code.

from lyra.

neuhaus avatar neuhaus commented on August 17, 2024

It's disappointing to see the recovery broken for lyra, after all that's the reason that people use it.
@jhalterman any input on this issue and #74?

from lyra.

jhalterman avatar jhalterman commented on August 17, 2024

I'm no longer actively working on Lyra, but would be happy to take a PR to disable automatic recovery when using Lyra.

from lyra.

michaelklishin avatar michaelklishin commented on August 17, 2024

Addressed in #82.

from lyra.

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.