Coder Social home page Coder Social logo

Customize consumer tag about rascal HOT 2 CLOSED

nico3dfx avatar nico3dfx commented on July 17, 2024
Customize consumer tag

from rascal.

Comments (2)

nico3dfx avatar nico3dfx commented on July 17, 2024

The consumerTag key can be configured inside the single subscription:

"subscriptions": {
    "test123": {
          "queue": "test123_queue",
                "options": {
                    "consumerTag": "test123_ctag"
                }
            }
    }

Not present in json schema file but the key dosen't invalidate the config.

from rascal.

cressie176 avatar cressie176 commented on July 17, 2024

Hi @nico3dfx,

in Rascal the consumer tag starts with "amq.ctag-*".

As you're no doubt aware, Rascal is a wrapper around amqplib, which is a RabbitMQ client, and therefore uses the AMQP 0.9.1 protocol. In the case of the consumer tag, it's actually RabbitMQ which will generate the value by default, unless the client provides one.

If you read the amqplib channel api consume documentation you will see this reiterated. However you can specify a consumerTag if you want to. When it comes to Rascal, there is usually an options object, which will be passed directly through to the equivalent amqplib function, both from config, and programmatically, with the latter taking precedence. e.g.

"subscriptions": {
  "test123": {
    "queue": "test123_queue",
      "options": {
        "consumerTag": "test123_ctag"
      }
    }
  }
} 
await subscription = broker.subscribe("s1", { consumerTag: "test123_ctag" })

In this case though I didn't include the property in the JSON schema, probably because it's I've never found a reason to hard code it. I don't think there will be an issue with setting as you have done though. I'll update the JSON schema accordingly.

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.