Skip to content

Add support for configuring additional routers #828

@ferblaca

Description

@ferblaca

We have been analyzing this spring-cloud/spring-cloud-stream#1790, and we see a clear backward step in functionality with FunctionRouter versus the filter conditions in @StreamListener.

These are the limitations we found with the FunctionRouter:

  • Only one FunctionRouter can be defined per application.
  • The FunctionRouter can only belong to one Binder: for example, and although it is rare, if your application consumes Rabbit and Kafka, the FunctionRouterhas to be configured with one of the binders, it will never be able to read two different data sources.
  • The FunctionRouter does not know the origin of the message consumed and therefore, even if it consumes from several topics, you can not customize a routing-expression depending on the origin of the message.

For all this, we see that the FunctionRouter is another functionality totally different from the filtering in the @StreamListener, which is a significant loss in terms of usability in Spring Cloud Stream with the functional approach.

We believe it would be important to reconsider this functionality and add at least some of the following features to the FunctionRouter:

  • Being able to define more than one FunctionRouter per application.
  • To be able to define one routing-expression per message origin. For example, if the FunctionRouter has configured topic1 and topic2 destinations, it would be nice to be able to define one routing-expression for topic1 messages and another routing-expression for topic2 messages.

Thank you very much, we hope that the request will be considered.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions