Search code examples
javaspringspring-el

Spring SpEL condition


I have added few event listeners like:

@EventListener(condition = "#message.state == 'sync'")
@EventListener(condition = "#message.state == 'update'")

It works. I need default one (to listen to all other cases for example message.state IS NOT IN ['sync', 'update']).

Can I have suggestion, how it can be done in good way?


Solution

  • "#message.state != 'sync' && #message.state != 'update'"

    ??