Skip to content

Unhardwire kafka key in notifications #4749

@fgalan

Description

@fgalan

Is your feature request related to a problem / use case? Please describe.

Kafka notificationa currently are using a hardwired key (equal to subscription id), which is not convenient in some case (see telefonicaid/kafnus#200 (comment))

Describe the solution you'd like

Add a new optional parameter in kafka/kafkaCustom https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#subscriptionnotificationkafkacustom for the key (key).

The value of that parameter would be a JEXL expression (note that a constant value, such null or a string is a particular case of valida JEXL expression).

Eg:

...
"notification": {
  "kafka": {
    "url": "kafka://broker1:9092,broker2:9092,broker3:9092",
    "topic": "sub1",
    "key": null
  }
}
...
...
"notification": {
  "kafka": {
    "url": "kafka://broker1:9092,broker2:9092,broker3:9092",
    "topic": "sub1",
    "key": "${id}"
  }
}
...

Describe alternatives you've considered
None

Describe why you need this feature

  • To improve or simplify an scenario.

Do you have the intention to implement the solution

  • Yes, I have the knowledge to implement this new feature.
  • Yes, but I will need help.
  • No, I do not have the skills.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions