Skip to content

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

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

Closed
spring-projects-issues opened this issue Apr 13, 2016 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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"/>
</task:scheduled-tasks>

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.

Thanks


Affects: 4.2 GA, 4.2.3, 4.3 RC1

Backported to: 4.2.7

@spring-projects-issues
Copy link
Collaborator Author

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.

Thanks

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: documentation A documentation task in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3 GA milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants