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

Reference Documentation: Why does not exist an XML configuration version for @Async? [SPR-14164] #18736

spring-issuemaster opened this issue Apr 13, 2016 · 1 comment


Copy link

@spring-issuemaster spring-issuemaster commented Apr 13, 2016

Manuel Jordan opened SPR-14164 and commented

I am doing some experiments about tasks and scheduling

After to read all this (my following content): consider include the explanation in the Reference documentation.

Taking in consideration first approach to declare a bean in Spring was with XML, later with annotations (@Component, @Service etc) and finally with JavaConfig.

I did realise about the following:

If we have @Scheduled, we have the XML version too such as:

<task:scheduled-tasks scheduler="myScheduler">
    <task:scheduled ref="beanA" method="methodA" fixed-delay="5000" initial-delay="1000"/>
    <task:scheduled ref="beanB" method="methodB" fixed-rate="5000"/>
    <task:scheduled ref="beanC" method="methodC" cron="*/5 * * * * MON-FRI"/>

And if we have @Async, why is not available an XML equivalent configuration?
Perhaps, something like

<task:async ref="beanA" method="methodA" />

It thinking if the developer does not want apply @Scheduled, how he can do the same approach for @Async?

Perhaps we have a .class or .jar file and we want apply Async support for a POJO where
the .java class is not available

I already have read the javadoc for @Async and reference documentation 33. Task Execution and Scheduling. There is no explanation about this behaviour

I am OK with these two annotations, but just wondered why does not exist for @Async the XML equivalent configuration such as @Scheduled.


Affects: 4.2 GA, 4.2.3, 4.3 RC1

Backported to: 4.2.7

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 15, 2016

Manuel Jordan commented

Even if exists a valid explanation, just curious if can enhanced the XML schemas to support something like

<task:async ref="beanA" method="methodA" />

I know Java Config and Spring Boot are available. But again, in case the .java file is not available (only .class) we can work around through XML

Let me know if I should create a new JIRA request.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.