Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters in channel address not used #722

Open
dankar opened this issue Feb 14, 2024 · 2 comments
Open

Parameters in channel address not used #722

dankar opened this issue Feb 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@dankar
Copy link

dankar commented Feb 14, 2024

Describe the bug

I have an MQTT protocol specification (asyncapi 3.0.0) which uses parameters in the addresses. These seem to be ignored by glee when it subscribes to the topics.

How to Reproduce

Create receive channel as follows:

channels:
  createUser:
    address: createUser/{userId}
    messages:
      createUser:
        payload:
          type: object
          properties:
            name:
              type: string
    parameters:
      userId:
        $ref: '#/components/parameters/
components:
  parameters:
    userId:
      examples: ['test']

What happens is that glee will subscribe to the topic 'createUser/{userId}' (literally).

Expected behavior

I guess it's open for debate what the expected behaviour should be, but I expect something along the lines of:

  1. glee subscribes to 'createUser/+' where + is a wildcard accepting any value
  2. glee provides the value for userId as parameter to the handler function.

Or optionally: some sort of call to enable subscriptions to a channel with a specific parameter value supplied.

Additionally, there seems to be no mechanism for sending a message to a channel which has parameters in the address. Maybe that should be another bug, but it's a bit moot at the point since it seems like the specified address is ignored when sending message on a channel (#721)

@dankar dankar added the bug Something isn't working label Feb 14, 2024
@KhudaDad414
Copy link
Member

@dankar. that makes sense. can you open a PR adding this functionality?

@dankar
Copy link
Author

dankar commented Mar 20, 2024

@KhudaDad414 I don't know the code base of this project enough to do this myself at this point. But if I get around to it some day, I will of course open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants