Coder Social home page Coder Social logo

Comments (5)

cressie176 avatar cressie176 commented on July 16, 2024 1

Hi @ea167,

This is not possible at the moment, but I agree it's a good feature.

There are a few options for implementing this, but my preferred one would be

{
  "vhosts": {
    "v1": {
      "connectionStrategy": "fixed",
      "connections": [
         "amqp://user:password@host1/v1",
         "amqp://user:password@host2/v1",
         "amqp://user:password@host3/v1",
      ]
    },
    "v2": {
      "connectionStrategy": "random",
      "connections": [
         "amqp://user:password@host1/v2",
         "amqp://user:password@host2/v2",
         "amqp://user:password@host3/v2",
      ]
    }
  }
}

The connectionStrategy would default to "random" for backwards compatibility. When "fixed" it maintain the order of connections in the array.

Pros

  • Simplicity
  • Little change
  • Supports different strategies per vhost

Cons

  • The strategy and url order must be repeated for each vhost if consistent behaviour is desired (partially mitigated by using rascal's defaults feature).
  • Specifying a connection strategy, but only having a single connection doesn't make sense

Thoughts?

from rascal.

cressie176 avatar cressie176 commented on July 16, 2024 1

Published as [email protected]

from rascal.

ea167 avatar ea167 commented on July 16, 2024

Brilliant Stephen @cressie176! Would be perfect!

I guess it only impacts lib/config/configure.js > getConnectionIndex,
where you can test connectionStrategy and branch between Math.random() and a simple sequence increment.

from rascal.

cressie176 avatar cressie176 commented on July 16, 2024

Yes, thanks what I'm thinking.

from rascal.

ea167 avatar ea167 commented on July 16, 2024

Bravo Stephen @cressie176! Amazing! 👏👏👏

from rascal.

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.