Camel
  1. Camel
  2. CAMEL-4391

Support for marking a CamelProxy as a primary or non-primary spring bean

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8.0
    • Fix Version/s: Future
    • Component/s: camel-spring
    • Labels:
    • Environment:

      N/A

    • Estimated Complexity:
      Moderate

      Description

      It would be very handy if a camelProxy bean (which is also a spring bean) could be defined as primary (see http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/htmlsingle/spring-framework-reference.html, search for @Primary).

      I have a content based route, which delegates to some other beans depending on argument values to the proxy. All three beans implement the same interface. So if I could just mark the proxy as primary that bean would be preferred.

      Other usecases where you would like it not to be primary probably exist as well.

      I suggest adding an optional boolean attribute "primary" which is by default true.

      1. test-context.xml
        0.7 kB
        David J. M. Karlsen
      2. TestCase.java
        0.6 kB
        David J. M. Karlsen
      3. SomeImpl.java
        0.1 kB
        David J. M. Karlsen
      4. SomeIface.java
        0.0 kB
        David J. M. Karlsen

        Activity

        Hide
        Claus Ibsen added a comment -

        Can you attach an unit test as a sample?

        Show
        Claus Ibsen added a comment - Can you attach an unit test as a sample?
        Hide
        David J. M. Karlsen added a comment -

        The attached testcase should show this pretty well

        Show
        David J. M. Karlsen added a comment - The attached testcase should show this pretty well

          People

          • Assignee:
            Unassigned
            Reporter:
            David J. M. Karlsen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development