Comments (11)
I've seen some interesting and very useful changes in the master branch and I'm wondering when
they will be released, are you close to a new release?
Or otherwise, would you say it's safe to point npm to the master branch directly in the meantime?
I don't think it's safe to point npm at a git repo in general. Lately I've changed my mind back and forth in the master branch, which I ought to have done in a feature branch, so there's an illustration of why not!
I'm not sure about the "resume" stuff yet, so I'll probably not release that for the time being. I may make a release without it, though.
from rabbit.js.
Great, thanks!
from rabbit.js.
I should say that while I don't recommend using git master in your production system, I would be grateful for any reports of using the new features in development
from rabbit.js.
Well, for example, we wanted to use one PUB socket to publish messages to different topics according to the current action our application is performing. We were reading the readme in the repo and tried it but later realised that in 0.4.0 it wasn't possible to use them this way. So now we are switching into creating different sockets for the different topics, and closing them after we don't need them anymore. I'm not sure but I think it shouldn't be that bad, since the real connection to the server is actually established when creating the context, right?
Any advice on this?
from rabbit.js.
Another thing is that we need our published messages to be stored in a queue so that they are not lost if the SUB socket hasn't connected yet before the PUB socket starts publishing. For now, we are using the HTTP API of RabbitMQ to create the queue (or make sure it's there) when the application starts. Is there a way we can manage queues and/or bindings from rabbit.js? It's not critical, just want to know haha
Thanks!
from rabbit.js.
So now we are switching into creating different sockets for the different topics, and closing them after we don't need them anymore.
Right, yes that is just the thing #publish
and the 'topic'
option are designed for.
var pub = ctx.socket('PUBLISH', { routing: topic });
pub.connect('events');
// ...
pub.publish('component.warning', JSON.stringify({foo: "bar"}), 'utf8');
Another thing is that we need our published messages to be stored in a queue so that they are not lost if the SUB socket hasn't connected yet
You would have to create a queue per subscriber, before starting any publishers, which is effectively the same as opening the sub sockets before you start any publishers. There's synchronisation required whatever you do.
RabbitMQ and AMQP won't help you with this, or not much. There's no provision for consumers catching up with old messages. If you cannot miss messages, better to stick them in a database and replay them for new subscribers, although you still have a kind of synchronisation problem (that is, figuring out when to switch from the replayed messages to the freshly-published messages).
from rabbit.js.
I see. For now we switched to creating and closing sockets for different topics until there's a new release. Do you think this is going to be a problem in terms of performance or anything like that?
Thanks a lot for the help.
from rabbit.js.
For now we switched to creating and closing sockets for different topics until there's a new release. Do you think this is going to be a problem in terms of performance or anything like that?
You are right that the connection is created just once; but, each socket still uses its own channel and may require some round-trips to declare various queues and what-have-you, so creating sockets is a little expensive too.
Perhaps I should roll a release with the topic stuff, and put the resume stuff on a branch for later.
from rabbit.js.
I see. Well that would be really awesome :D let me know if you do it, since we would change our code accordingly as soon as possible.
from rabbit.js.
v0.4.1 is published to npm. It has the topic stuff and the persistent
option, but not the subscription resume stuff.
from rabbit.js.
Amazing! Thanks a lot!
from rabbit.js.
Related Issues (20)
- update dependencies and fix verion warnings HOT 1
- cannot connect to SUB HOT 1
- context.close() does not emit "close" event
- How to make a durable named queue?
- [SOLVED] Cant connect to remote host HOT 1
- Identifying the Queue name HOT 2
- Queue durability, exclusivity and consumerTag HOT 1
- Allow control over exchange creation HOT 4
- How to get the contents of header?
- bump amqp.node version to 0.4.4 (Node 4.x) HOT 1
- rabbit.js within AngularJS HOT 6
- How best to implement distributed semaphores? HOT 3
- Running REQ/REP as an RPC
- Advantage of using over plain AMQPLIB HOT 1
- Connect callback not optional
- List queues?
- message in queue impact by another message
- How to set queue x-max-length parameter HOT 3
- example error HOT 1
- Prefetch option can only be set through setsockopt and not as part of socket argument.
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 rabbit.js.