Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4256

Adding a EndpointConfiguration interface


    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.8.0
    • Component/s: camel-core
    • Labels:
    • Patch Info:
      Patch Available


      One of the key missing pieces from the API is the explicit concept of EndpointConfiguration. We use URIs for that, ant that's great, but we don't have it in the API. Some components do have an informal version though.

      I am proposing adding an EndpointConfiguration interface:

      public interface EndpointConfiguration {
        void fromUri(String uri);
        String toUri();

      and maybe other methods, we could also use URI instead of string for pre-parsing. Same as with other concepts the default implementation would be in impl and components would extend that and add fields for configuration parameters.
      This would solve problems related to URI uniqueness to a good extent as toUri() should always place parameters in the same order. The Endpoint interface would change though.

      The main advantage would be that we can annotate parameters and use javax.validation to specify if a field is @ProducerOnly, @ConsumerOnly for example, which may exclude them from toUri() (yes, there are some impacts, the id uri would be different than the config uric). We could annotate them with @Secret to indicate that at least the value should not appear in clear in the uri, etc. We could also add an @Default("value"), allowing us to exclude from the uri fields set on the default value (even if the filed was explicitly set) and so on.

      This would also make static validation possible unit testing configuration would be vastly simplified and we could improve coverage. We can do it in an incremental way without a big impact on existing components (especially outside camel) via changes in DefaultEndpoint. I am working on a prototype, but feedback is highly appreciated.


        1. CAMEL-4256-test.diff
          4 kB
          Łukasz Dywicki
        2. CAMEL-4256-rmi.diff
          25 kB
          Łukasz Dywicki
        3. CAMEL-4256-core.diff
          4 kB
          Łukasz Dywicki
        4. CAMEL-4256-2.patch
          2 kB
          Keith Babo
        5. camel-4256.patch
          30 kB
          Hadrian Zbarcea
        There are no Sub-Tasks for this issue.



            • Assignee:
              hadrian Hadrian Zbarcea
              hadrian Hadrian Zbarcea
            • Votes:
              2 Vote for this issue
              2 Start watching this issue


              • Created: