Comments (5)
If I go into the RabbitMQ Web UI and manually bind queue "WebService.Machine2" to exchange "WebService" and publish, then both machines receive the message. I think this should be what NServiceBus does for you right?
from nservicebus.rabbitmq.
For additional information about what I'm talking about, visit http://jmcle.github.io/rabbitmq-visualizer/ and click on the "Import" button and paste in the following JSON:
{
"exchanges": [
{
"name": "Engine.Messages.Inventory:InventoryUpdatedEvent",
"type": "1",
"x": 312,
"y": 237,
"resource_type": "exchange",
"id": 1
},
{
"name": "WebService",
"resource_type": "exchange",
"id": 34,
"type": "1",
"x": 559,
"y": 231
},
{
"name": "WebService.USAM-GATQAWEB1",
"resource_type": "exchange",
"id": 37,
"type": "1",
"x": 554,
"y": 372
},
{
"name": "WebService.USB-PCTBSTIMB",
"resource_type": "exchange",
"id": 38,
"type": "1",
"x": 553,
"y": 506
}
],
"queues": [
{
"name": "WebService",
"resource_type": "queue",
"id": 39,
"type": 0,
"x": 762,
"y": 230,
"messages": [],
"totalConsumers": 2,
"lastConsumer": 0
},
{
"name": "WebService.USAM-GATQAWEB1",
"resource_type": "queue",
"id": 50,
"type": 0,
"x": 762,
"y": 371,
"messages": [],
"totalConsumers": 1,
"lastConsumer": 0
},
{
"name": "WebService.USB-PCTBSTIMB",
"resource_type": "queue",
"id": 54,
"type": 0,
"x": 768,
"y": 505,
"messages": []
}
],
"bindings": [
{
"source": 8,
"vhost": "default",
"source_type": "producer",
"destination": 1,
"destination_type": "exchange",
"id": 16,
"routing_key": "di.usr.one",
"arguments": []
},
{
"source": 1,
"vhost": "demo",
"destination": 1,
"destination_type": "exchange",
"routing_key": "key",
"arguments": [],
"id": 35,
"source_type": "exchange"
},
{
"source": 34,
"vhost": "demo",
"destination": 39,
"destination_type": "queue",
"routing_key": "key",
"arguments": [],
"id": 40,
"source_type": "exchange"
},
{
"source": 39,
"vhost": "demo",
"destination": 41,
"destination_type": "consumer",
"routing_key": "key",
"arguments": [],
"id": 43,
"source_type": "queue"
},
{
"source": 39,
"vhost": "demo",
"destination": 42,
"destination_type": "consumer",
"routing_key": "key",
"arguments": [],
"id": 44,
"source_type": "queue"
},
{
"source": 1,
"vhost": "demo",
"destination": 34,
"destination_type": "exchange",
"routing_key": "key",
"arguments": [],
"id": 46,
"source_type": "exchange"
},
{
"source": 37,
"vhost": "demo",
"destination": 50,
"destination_type": "queue",
"routing_key": "key",
"arguments": [],
"id": 51,
"source_type": "exchange"
},
{
"source": 50,
"vhost": "demo",
"destination": 41,
"destination_type": "consumer",
"routing_key": "key",
"arguments": [],
"id": 52,
"source_type": "queue"
},
{
"source": 38,
"vhost": "demo",
"destination": 54,
"destination_type": "queue",
"routing_key": "key",
"arguments": [],
"id": 55,
"source_type": "exchange"
},
{
"source": 54,
"vhost": "demo",
"destination": 42,
"destination_type": "consumer",
"routing_key": "key",
"arguments": [],
"id": 56,
"source_type": "queue"
}
],
"producers": [
{
"name": "GAT.Cloud.PhoenixDepartures",
"x": 107,
"y": 184,
"interval": 5,
"publish": {
"to": 1,
"payload": "one",
"routing_key": "di.usr.one"
},
"resource_type": "producer",
"id": 8
}
],
"consumers": [
{
"name": "QA",
"resource_type": "consumer",
"id": 41,
"type": 0,
"x": 1054,
"y": 228
},
{
"name": "Localhost",
"resource_type": "consumer",
"id": 42,
"type": 0,
"x": 1050,
"y": 504
}
]
}
Then press shift + click on the green circle. You'll notice that it does round robin messaging. Whatever the default NServiceBus + RabbitMQ topology is, shouldn't it take into account that a publish should really make it to both consumers 100% of the time?
from nservicebus.rabbitmq.
What version of NServiceBus.RabbitMQ is this?
Since we handle callbacks more explicit now the UseSingleBrokerQueue
setting is a no-op since it was only introduced to make callbacks work when scaled out. In this case what you need is to make the web endpoints unique so that each one of them gets the message. You can do this by adding the machine name to the endpoint name using:
config.EndpointName("MyEndpoint" + Environment.MachineName)
Does this make sense?
from nservicebus.rabbitmq.
We are on the latest version of rabbitmq. That was actually the route that I took in the end and it works. The only thing is that if I do that then it sort of makes a "send" a little strange because in the message routing you would have to know the machine name as well. Perhaps that is not a big deal. I just wasn't certain that that was the proper solution. But if you recommend it then I will go with it :-)
Sent from my iPhone
On Jan 18, 2015, at 11:12 AM, Andreas Γhlund [email protected] wrote:
What version of NServiceBus.RabbitMQ is this?
Since we handle callbacks more explicit now the UseSingleBrokerQueue setting is a no-op since it was only introduced to make callbacks work when scaled out. In this case what you need is to make the web endpoints unique so that each one of them gets the message. You can do this by adding the machine name to the endpoint name using:
config.EndpointName("MyEndpoint" + Environment.MachineName)
Does this make sense?
β
Reply to this email directly or view it on GitHub.
from nservicebus.rabbitmq.
Another option would be to have the web servers share the storage (eg. distributed cache). That way all instance will have the same data regardless of which one gets the message.
from nservicebus.rabbitmq.
Related Issues (20)
- Message pump leaks connections while reconnecting to the broker when the queue is unavailable
- Endless loop when bus had been stopped while transport is trying to reconnect HOT 5
- Investigate if ability to provide a custom ArrayPool can provide any performance benefit
- Expose ConnectionFactory.MaxMessageSize on the transport configuration API
- Stopping an endpoint floods the log with "Reconnecting to the broker failed: System.ObjectDisposedException" HOT 1
- Add automated tests that runs against AmazonMQ
- Add automated tests that runs against CloudAMQP
- Endpoint never reconnects to RabbitMQ after channel timeout HOT 7
- Multi target commandline to net6, net7 and newer
- Retries of headerless message causes indefinite requeuing on classic queues HOT 5
- Message loss in migrate-to-quorum command HOT 3
- Automatic rate limiting feature might cause duplicate messages HOT 1
- nsbVersion can't be computed in single file deployments HOT 2
- Messages go into infinite immediate retries in case there are a lot of messages (over 100) with persistent issue while processing. HOT 5
- ChannelProvider Publish reconnection attempts continue forever after IEndpointInstance had been stopped HOT 9
- Suppress creation of `nsb.v2.verify-stream-flag-enabled` queue HOT 2
- Ability to not have the delayed delivery infrastructure created
- Should we expose a way to configure the Consumer Acknowledgement Timeout HOT 1
- Immediate retry count does not increase for rabbit messages which are sent to queue without "message_id" property after upgrade to NServiceBus 8 HOT 5
- Enhance code readability and using .NET 8 new features 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 nservicebus.rabbitmq.