Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4811

Allow conduit match pattern to be customized.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.4.3
    • None
    • Integration
    • None
    • Advanced

    Description

      Use-case:
      Developed jaxrs client has no knowledge of the server URL until it is shipped to a customer.
      To address the issue, server name and port has been externalized and handled by a standard PropertyPlaceholderConfigurer:

      <jaxrs:client id="serviceClient"
      address="http://${server.name}:${server.port}/services/*"/>
      
      <context:property-placeholder/>
      
      <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
      		<property name="order" value="1"/>
      		<property name="ignoreUnresolvablePlaceholders" value="false"/>
      </bean>
      

      But currently http conduit can not be configured as match pattern is set the conduit name, rather than a property.

      <cxf-http:conduit name="http://localhost/services.*" />
      

      The best option is to introduce custom URL Matchers, so conduit delegate actual URL matching to a configurable implementation.

      Than a simple solution would be to extend org.apache.cxf.configuration.spring.ConfigurerImpl and resolve the property placeholders before compiling the pattern in initWildcardDefinitionMap method. But the poor architectural decisions led to PropertyResourceConfigurer to be non-reusable. It supports rigid visitor pattern, and do not even provide a method to resolve a property placeholder after postProcessBeanFactory has been called.

      So the dirty hack would be to configure pattern in the conduit property, rather in the name.

      <cxf-http:conduit id="service1Conduit">
        <property name="url" value="http://${server.name}:${server.port}/services/*">
      </cxf-http:conduit>
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ivan.latysh Ivan Latysh
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: