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

Add support for 'condition' matching on @Subscriber similar to Spring's @EventListener #23

Open
longwa opened this issue Jul 17, 2018 · 0 comments

Comments

@longwa
Copy link

longwa commented Jul 17, 2018

Spring's @EventListener has a condition attribute that can use an SpEL expression to match:

@EventListener(condition = "#creationEvent.awesome")
public void handleOrderCreatedEvent(CreationEvent<Order> creationEvent) {
}

It would be super handy if @Subscriber could add the same support. This would allow for a better replacement to the pattern matching support that @Selector used to provide with the legacy reactor bus.

Also, we have an enumeration for our eventTypes to make it easier to find and maintain. Having the SpEL expression would allow us to match based on the actual enum value instead of needing to duplicate the string for the eventId (since you can't say value = MyEnum.name() in an annotation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant