Skip to content

Support @AliasFor for @JmsListener attributes [SPR-13803] #18376

Closed
@spring-projects-issues

Description

@spring-projects-issues

Grzegorz Poznachowski opened SPR-13803 and commented

I want to wrap @JmsListener annotation with a custom one (to avoid providing containerFactory attribute):

@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JmsListener(containerFactory = "customJmsContainerFactory", destination = "")
public @interface CustomJmsListener {

    @AliasFor(annotation = JmsListener.class, attribute = "destination")
    String destination();

    @AliasFor(annotation = JmsListener.class, attribute = "selector")
    String selector() default "";

    @AliasFor(annotation = JmsListener.class, attribute = "concurrency")
    String concurrency() default "";
}

As destination is a required attribute I need to provide its value: destination = "". I would expect that it would be overridden by specifying destination attribute on @CustomJmsListener, however the @JmsListener value is being used.


Affects: 4.2.3

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions