camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Bjørnstad <joak...@gmail.com>
Subject Re: Spring to Plain Vanilla Camel
Date Thu, 15 Oct 2015 07:39:47 GMT
Hello,

On Thu, Oct 15, 2015 at 5:27 AM, contactreji <contactreji@gmail.com> wrote:
> Hello guys
>
> We are considering groovy dsl using plain vanilla camel coding. All beans
> would probably go in as @Autowired into RouteBuilder classes. I just need
> some inputs on how following CXF Endpoint config can be written in a Java
> class representation.
>
> We were kind of used to Spring XML before. Now we are exploring more on pure
> java / groovy style.
>
> *
> <cxf:cxfEndpoint id="EnterpriseIntegrationService"
>                 address="${CXF_Endpoint}"
>                 xmlns:c="http://mySoapServiceWSDL"
>                 endpointName="c:EnterpriseIntegrationSOAP11port_http"
> serviceName="c:EnterpriseIntegrationService"
>                 wsdlURL="Artifacts/wsdl/BSSApi/ServiceDefinition.wsdl">
>                 <cxf:properties>
>                         <entry key="dataFormat" value="PAYLOAD" />
>                         <entry key="ws-security.callback-handler" value-ref="passwordCallback"
/>
>                         <entry key="receiveTimeout" value="15000" />
>                         <entry key="connectionTimeout" value="2000" />
>                 </cxf:properties>
>                 <cxf:inInterceptors>
>                         <ref bean="gzipInterceptor" />
>                 </cxf:inInterceptors>
>                 <cxf:outInterceptors>
>                         <ref bean="passwordCallback_bss" />
>                         <ref bean="bssapiWss4jOutInterceptor" />
>                 </cxf:outInterceptors>
>         </cxf:cxfEndpoint>*
>


I think this would be pretty close. Please note that I think you
possibly might have to configure the receiveTimeout and
connectionTimeout on the client HttpConduit, not entirely sure on how
to do this on the top of my head.

You could then refer to this in your route as
.to("cxf:bean:enterpriseIntegrationService") or maybe just
.to(enterpriseIntegrationService) assuming it is @Autowired in to the
RouteBuilder.

@Autowired
private GZIPInInterceptor gzipInInterceptor;
@Autowired
private PasswordCallback_bss passwordCallback_bss;
@Autowired
private BssapiWss4jOutInterceptor bssapiWss4jOutInterceptor;
@Autowired
private PasswordCallback passwordCallback;

@Bean
public CxfEndpoint enterpriseIntegrationService() {
    CxfEndpoint cxfEndpoint = new CxfEndpoint();
    cxfEndpoint.setAddress("${CXF_Endpoint}");
    cxfEndpoint.setWsdlURL("Artifacts/wsdl/BSSApi/ServiceDefinition.wsdl");
    cxfEndpoint.setEndpointName(new QName("http://mySoapServiceWSDL",
"EnterpriseIntegrationSOAP11port_http"));
    cxfEndpoint.setServiceName(new QName("http://mySoapServiceWSDL",
"EnterpriseIntegrationService"));
    cxfEndpoint.setDataFormat(DataFormat.PAYLOAD);
    cxfEndpoint.setProperties(cxfProperties());
    cxfEndpoint.getInInterceptors().add(gzipInInterceptor);
    cxfEndpoint.getOutInterceptors().add(passwordCallback_bss);
    cxfEndpoint.getOutInterceptors().add(bssapiWss4jOutInterceptor);
    return cxfEndpoint;
}

private Map<String, Object> cxfProperties() {
    Map<String, Object> properties = new HashMap<>();
    properties.put("ws-security.callback-handler", passwordCallback);
    properties.put("receiveTimeout", "15000");
    properties.put("connectionTimeout", "2000");
    return properties;
}

>
>
> -----
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss
Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context: http://camel.465427.n5.nabble.com/Spring-to-Plain-Vanilla-Camel-tp5772667.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Kind regards
Joakim Bjørnstad

Mime
View raw message