Comments (1)
If you have a publish-only workload you will always encounter this issue when you publish infrequently. The underlying reason is that we need to send heartbeats to the RabbitMQ server every 30s in order for the connection to remain active, and those heartbeats aren't sent unless you call publish()
(or anything else that interacts with the connection).
As an aside: originally this package did not use hearbeats, but we discovered that this causes extremely brittle network connections that can crash/timeout R for periods of 15 minutes, so they are now enabled with no option to turn them off. It's the lesser of two evils.
The fundamental problem here is that R (and the underlying librabbitmq
) is single-threaded, and so we can't really do stuff "in the background" like send heartbeats.
I have a few suggestions, based on our experience:
-
If you are publishing and consuming on the same connection, ensure you call
amqp_consume()
more often than the heartbeat timeout. Of course, if you are only publishing this is not very helpful. -
If you are publishing infrequently, consider also publishing a separate "hello, world" message to a dedicated exchange every 10-30s. This is actually a pretty common pattern for monitoring the health of an application anyway.
-
If you are publishing very infrequently, just create a new connection, publish, and then close the connection.
Unfortunately there is no way to indicate whether we got disconnected due to missed heartbeats, which is why the error message won't tell you. And we do try to recover from errors, but this is not actually an error -- it is intentional behaviour.
from longears.
Related Issues (16)
- Acknowledgements HOT 16
- Publishing raw data HOT 2
- Issue compiling on Ubuntu against librabbitmq 0.4.1 HOT 7
- Prefetch Size HOT 3
- longears not in CRAN or its archives HOT 4
- How to keep consumer alive HOT 5
- Installation at Google Colab R HOT 1
- Support for brokers with SSL HOT 1
- cannot demonstrate minimal usage; please advise HOT 2
- Add a vignette about working with acknowledgements
- The timeout is limited to 10 seconds. HOT 1
- r-hub / r-minimal HOT 1
- Why is the message payload encoded ?
- Consume messages in a Shiny application
- Can't get Direct Reply-to to work
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 longears.