Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions