2016-09-19 5 views
0

오른쪽 난 코드 아래에 따라 하나의 휴식 서비스에 대한 단일 소비자를 매핑 할 수 없습니다 :단일 소비자에 대한 모든 나머지 요청을 포착하고 cxfrs를 사용하여 실제 나머지 웹 서비스로 전달할 수 있습니까?

경로 구성 : 통합에서

<bean class="com.x.ws.integration.route.SampleRouteProcessor" 
    id="sampleRouteProcessor" /> 
<camel:routeContext id="xyz"> 
    <camel:route xmlns="http://camel.apache.org/schema/spring"> 
     <camel:from 
      uri="cxfrs:bean:getSampleHoliDay?bindingStyle=SimpleConsumer" /> 
     <camel:setHeader headerName="CamelHttpMethod"> 
      <constant>GET</constant> 
     </camel:setHeader> 
     <camel:setHeader headerName="Content-Type"> 
      <constant>application/json</constant> 
     </camel:setHeader> 
     <camel:setHeader headerName="accept"> 
      <constant>application/json</constant> 
     </camel:setHeader> 

     <camel:to uri="cxfrs:bean:getSampleHoliDayClient" /> 
    </camel:route> 
</camel:routeContext> 
<cxf:rsServer id="getSampleHoliDay" loggingFeatureEnabled="true" 
    serviceClass="com.nucleus.rest.consumer.RestConsumerImpl"> 

    <cxf:providers> 
     <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" /> 
    </cxf:providers> 
</cxf:rsServer> 
<!--Create receipt REST service Producer service client --> 
<cxf:rsClient id="getSampleHoliDayClient" 
    address="http://10.*.*.*:*/sample-integration/rest/" 
    loggingFeatureEnabled="true"> 
    <cxf:providers> 
     <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" /> 

    </cxf:providers> 
</cxf:rsClient> 

소비자 : 이제

import java.util.Map; 
import javax.ws.rs.GET; 
import javax.ws.rs.Path; 
import javax.ws.rs.Produces; 
import javax.ws.rs.core.MediaType; 

@Path("/") 
public interface RestConsumer 
{ 

    @GET 
    @Path("/getSampleRequest") 
    @Produces(MediaType.APPLICATION_JSON) 
    public Map<String, Object> getSampleResponse(); 
} 

을 내가 @Path을 할 경우 ("/ *") 작동하지 않습니다. 모든 나머지 요청을 잡아서 그에 따라 전달할 수 있어야하는 단일 RestConsumer를 만들고 싶습니다.

답변