Giter Site home page Giter Site logo

Comments (5)

burkhartt avatar burkhartt commented on June 19, 2024

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.

burkhartt avatar burkhartt commented on June 19, 2024

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.

andreasohlund avatar andreasohlund commented on June 19, 2024

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.

burkhartt avatar burkhartt commented on June 19, 2024

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.

andreasohlund avatar andreasohlund commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.