Spring Integration
  1. Spring Integration
  2. INT-2417

Add Bean Name Alias for Beans with Generated Names

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 2.1 GA
    • Fix Version/s: 2.2 M2
    • Component/s: Core
    • Labels:

      Description

      Parsers generate bean names for handlers within consuming endpoints, e.g.

      org.springframework.integration.handler.LoggingHandler#0

      It would be useful if these beans could have aliases (e.g. endpoint.handler) so a reference to the handler could be easily obtained from the context.

        Issue Links

          Activity

          Hide
          Mark Fisher added a comment -

          If we can ensure uniqueness, we could even replace the generated name with our own more meaningful names, right?

          Show
          Mark Fisher added a comment - If we can ensure uniqueness, we could even replace the generated name with our own more meaningful names, right?
          Hide
          Gary Russell added a comment -

          Right, the uniqueness would be maintained by using the endpoint id as a prefix (like the way we do with channel.adapter) but I figured we could keep the generated name in case someone is already using it.

          It's brittle, because the parse order matters, but it is possible someone might have, say, one instance of a handler and @Autowire it with a @Qualifier, or get it by name from the context.

          Show
          Gary Russell added a comment - Right, the uniqueness would be maintained by using the endpoint id as a prefix (like the way we do with channel.adapter) but I figured we could keep the generated name in case someone is already using it. It's brittle, because the parse order matters, but it is possible someone might have, say, one instance of a handler and @Autowire it with a @Qualifier, or get it by name from the context.
          Hide
          Mark Fisher added a comment -

          Sure, I guess it doesn't hurt. Maybe for 3.0 we could consider removing the generated names altogether.

          Show
          Mark Fisher added a comment - Sure, I guess it doesn't hurt. Maybe for 3.0 we could consider removing the generated names altogether.
          Show
          Gary Russell added a comment - PR: https://github.com/SpringSource/spring-integration/pull/447

            People

            • Assignee:
              Gary Russell
              Reporter:
              Gary Russell
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified