Announcement Announcement Module
Collapse
No announcement yet.
@Scheduled(cron) does not support SpEL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Scheduled(cron) does not support SpEL

    Hello,
    I've noticed that the @Scheduled annotation does not support SpEL ( I've noticed that the StringValueResolver interface is implemented by PlaceholderResolvingStringValueResolver etc, but not with any SpEL class ).
    Is there a way today to use SpEL in the @Scheduled annotation?
    If not - why? and will it be possible?

    Thanks,

    Noam

  • #2
    Hello

    If you read the @Scheduled API it only work with cron.

    Seems you have must write statically your cron expression

    Comment


    • #3
      Hi Dr.,

      Thanks for the reply - but I think my question was not clear.
      I used @Scheduled with cron expression by the following:
      When I used:
      1) Statically expression - It worked fine.
      2) Placeholder ( the expression was in scheduler.properties file and I've wrote @Scheduled(cron="${cron}") ) - It worked fine.
      3) SpEL ( I've used the same property file and wrote @Scheduled(cron="#{scheduler['cron']") ) - It didn't workd.
      So my question were:
      Did I do something wrong here?
      Does @Scheduled ( with cron ) support SpEL?
      If not - Is there intention of supporting SpEL in this situation?

      Thanks,

      Noam.

      Comment

      Working...
      X