Comments (4)
Anyone have any ideas on how to fix this?
from node-amqp.
My understanding from the Readme was that the passive option allowed one to check to see if the queue exists, not create it if it does not exists. From the readme, "The client can use this to check whether a queue exists without modifying the server state".
When I did some testing, I created the queue if I did not get one using the passive: true option; and that seemed to work.
from node-amqp.
Anyone actually solving this?
there's no way to catch this error, nothing I could think of, rendering passive completely useless
from node-amqp.
It worked fine for me. The passive option just checks to see if the queue already exists; it will not create the queue. I used something like the following:
function createQueue (conn,qname,opts,cb){
if ( _.isFunction(opts)){
cb = opts;
opts = {};
}
var f = Futures.future({error: function(){}});
f.when(function(){
cb.apply(cb,arguments);
});
var ncb = f.fulfill;
var me = this;
var q = conn.queue(qname, {passive: true}, function(queue){
ncb(false,queue);
}).on('error', function(){
doCreateQueue(conn,qname,opts,ncb);
})
}
function doCreateQueue(conn,qname,opts,cb){
conn.queue(qname,opts,function(queue){
cb,(false,queue);
}).on('error',function(err){
cb(err,null);
});
}
To be fair, I forked this project and made some modifications, but I do not think any of them changed this behavior.
from node-amqp.
Related Issues (20)
- Error: Unmatched field {"name":"consumerTag","domain":"shortstr"} HOT 2
- Batch queue subscribe/unsubscribe
- RabbitMQ failover server HOT 2
- Many connections seen on rabbitmq server while only one can be seen on client
- Alternative approach for immediate and mandatory options during publish
- "ack.acknowledge()" sometimes is invalid
- RangeError: Maximum call stack size exceeded
- add callback when heartbeat is failed
- Help: Queue with ack = true and prefetchCount >1. Multiple handlers
- connection.disconnect() fires the error handler with connection reset HOT 5
- How to reject on acknowledge using messageObject callback argument HOT 1
- test-connection-disconnect.js unit test failed
- Error: read ECONNRESET when define a property to Object
- Unmaintained? HOT 3
- connection publish callback not executed HOT 1
- Facing Error: read ECONNRESET while running tests in the package
- Connection ended: possibly due to an authentication failure HOT 1
- Persistence parameters have been set, but not in effect
- S HOT 1
- Y 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 node-amqp.