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

Validator Component: Support custom resource resolver which depends on dynamic resource URI of the endpoint

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.17.0
    • camel-core
    • None
    • Patch Available
    • Unknown

    Description

      The validator endpoint allows already to specify custom resource resolvers, via the parameter resourceResolver. However, there is a use case where this functionality is not sufficient. If you have a dynamically created validator endpoint, like

      <camel:recipientList>
      <camel:simple>validator:${header.XSD_FILE}?resourceResolver=#resourceResolver</camel:simple>
      </camel:recipientList>

      where the resource URI of the XSD document is also dynamic (in the example via the header XSD_FILE) and if your resource resolver depends on the resource URI of the XSD document, then the current implementation gives you no solution for this problem. You cannot hand-over the dynamic resource URI to the custom resource resolver.

      Therefore we introduce the new parameter resourceResolverFactory where you can specify a factory which implements the method

      LSResourceResolver createResourceResolver(CamelContext camelContext, String rootResourceUri);

      This method is called when the endpoint is created and gives you access to the endpoint resource URI (parameter rootResourceUri).

      Remark: resource resolvers need to have the root resource URI in the case of relative URIs.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            forsthofer Franz Forsthofer
            forsthofer Franz Forsthofer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment