Comments (3)
You can't publish to a specific queue because many subscribers builds a queue group. The publisher is not aware of that. If you have one queue group and many instances (default) the request will be load balanced across all subscribers. If you have a custom queue group with the same topic the request will arrive one instance doesnt matter how much this service is scaled but if you have many different queue groups per add
with the same topic the request will load balanced for each group so multiple subscriber will receive that event.
Default: topic = queue-group
add('topic:math,cmd:add')
Worker Queue: If you scale your service the request will receive only one instance. (Doesnt matter whether pubsub or request/reply)
add('topic:math,cmd:add,queue$:test')
add('topic:math,cmd:add,queue$:test')
Custom queue per add: The request will receive at least one time for each custom queue-group
add('topic:math,cmd:add,queue$:test1')
add('topic:math,cmd:add,queue$:test2')
from hemera.
I have had a quick view of the source code, guessing that I may code as below:
// group-1 with many instances
hemera.add({
$queue: 'group-1'
topic: 'sth-happened'
}, handler)
// group-2 with many instances
hemera.add({
$queue: 'group-2'
topic: 'sth-happened'
}, handler)
hemera.act({
$pubsub: true,
topic: 'sth-hanppened'
})
Does this implement what I issued before?
Thanks.
from hemera.
Closed due to inactivity.
from hemera.
Related Issues (20)
- Logging id HOT 15
- Direct communication ? HOT 3
- stats plugin not returning all actions HOT 7
- Does hemera.close() killall running jobs? HOT 2
- TypeError when defining custom Pino logger HOT 1
- Why https://hemerajs.github.io/hemera/docs/reference.html contains not documentation for add() function. HOT 3
- Adding hemera to Docusaurus users page HOT 3
- Unsubscribe by RegExp HOT 9
- Unable to subscribe to NATS topic when the publisher is not running on Hemera HOT 1
- Client Timeout HOT 3
- hemera-ajv doesnt seem to be working correctly HOT 4
- Hemera-blipp has old hemera version HOT 3
- Have you looked into ts-nats? HOT 3
- How to reply from middleware or extension? HOT 5
- Looking for maintainers and collaborators HOT 5
- NATS disconnection question HOT 1
- Calling reply.send inside async middleware doesn't stop the chain HOT 2
- Typescript support HOT 1
- hemera-zipkin package missing HOT 3
- Any way to unregister an extension? HOT 2
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 hemera.