Comments (8)
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.
added a PR, not sure how to release a new version though, I think that is up to you :)
from lyra.
Hello,
Just wanted to ping you to check if you maybe have time to get back to me on this :)
Kind regards.
from lyra.
@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.
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.
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.
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.
Addressed in #82.
from lyra.
Related Issues (20)
- Reconnection after RabbitMQ shutdown is not successful HOT 5
- when java.net.UnknownHostException is thrown the recovery failed
- What about moving to the latest 'amqp-client' version?
- Forgotten copying of automaticRecovery in ConnectionOptions.copy() HOT 1
- Documentation on ConnectionFactory used in ConnectionOptions HOT 2
- support withUri() in ConnectionOptions HOT 5
- Moving to latest RabbitMQ Java Client 4.0 HOT 5
- Why to copy ConnectionFactory on each create HOT 7
- No communication after recovery HOT 4
- Connection name is not passed HOT 8
- RabbitMQ flooded by new connections HOT 5
- Lyra recover mechanism can prevent from the JVM to shutdown HOT 6
- Get rid of static executor service HOT 2
- Rapid growth of connections when network conditions are unreliable HOT 3
- retryableExceptions configuration and implementation HOT 3
- Use a `Predicate` for retry exception strategy
- Getting Rabbitmq HeartBeat Exception HOT 3
- Lyra is no longer under active development. HOT 1
- Connection recovery fails and gives up even though recovery policy is recoverAlways() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lyra.