krakend / krakend-pubsub

a pubsub backend for the KrakenD framework
https://www.krakend.io
Apache License 2.0
10 stars 16 forks source link

Subscribe to topics/queues with path variables or query string params #14

Closed thegoncalomartins closed 2 years ago

thegoncalomartins commented 2 years ago

Hi 👋

Are there any plans to support subscribing to topics/queues based on path variables or query string parameters?

Examples:

{
      "endpoint": "/{topic}/messages",
      "backend": [
          {
              "host": [ "kafka://" ],
              "disable_host_sanitize": true,
              "extra_config": {
                  "github.com/devopsfaith/krakend-pubsub/subscriber": {
                      "subscription_url": "group?topic={topic}"
                  }
              }
          }
      ]
  }
{
      "endpoint": "/messages",
      "querystring_params": [
          "topic"
       ],
      "backend": [
          {
              "host": [ "kafka://" ],
              "disable_host_sanitize": true,
              "extra_config": {
                  "github.com/devopsfaith/krakend-pubsub/subscriber": {
                      "subscription_url": "group"
                  }
              }
          }
      ]
  }

Thanks in advance.

kpacha commented 2 years ago

The pubsub component can't do that. The subscription must be defined at the configuration and it is immutable

github-actions[bot] commented 2 years ago

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.