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

Use Apache Camel .bean method instead of @Autowired+.processor #146

Open
dgroup opened this issue May 15, 2022 · 0 comments
Open

Use Apache Camel .bean method instead of @Autowired+.processor #146

dgroup opened this issue May 15, 2022 · 0 comments

Comments

@dgroup
Copy link
Owner

dgroup commented May 15, 2022

Summary

Key Value
Rule UseBeanInsteadOfProcessor
arch4u version TBD

Your rule definition

<rule name="UseBeanInsteadOfProcessor"
      since="0.2.0"
      language="java"
      externalInfoUrl="https://github.com/dgroup/arch4u-pmd/discussions/..."
      message="...: https://github.com/dgroup/arch4u-pmd/discussions/..."
      class="io.github.dgroup.arch4u.pmd....">
    <priority>3</priority>
</rule>

Describe the defect or false/positive rule violation

...

@Component
public final class TheRouteOne extends RouteBuilder {

    @Override
    public void configure() {
        from("direct:src")
            ... 
            .bean(ApacheCamelProcessor.class) // ok
            ...
    }

}

...

@Component
public final class TheRouteTwo extends RouteBuilder {
    @Authowired
    ApacheCamelProcessor processor;

    @Override
    public void configure() {
        from("direct:src")
            ... 
            .processor(this.processor) // violation
            ...
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant