camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anupamsen <anupam...@yahoo.com>
Subject Making Camel based middle layer available even when services are not
Date Thu, 11 Oct 2012 12:16:57 GMT
Hi There,

In any integration solution there is a high possibility that one of the
consumed services are unavailable but the integration layer should still be
available. The same case applies to my problem statement, that is I have the
following -

1) The integration gateway connects to service-1 which is our internal
service
2) The integration gateway connects to service-2 which is some external
thirdparty service

we want the integration gateway to be available even when the service-2 is
unavailable. Presently the flow is something like the following -
1) Thirdparty solution calls service-1 through the gateway in async mode.
2) Once the service-1 is through processing we call the thirdparty service-2
to push the acknowledgements.

Service-2 is hosted as a webservice by the thirdparty and we have the
following definition for the endpoint for this -

  <cxf:cxfEndpoint id="AckServiceEndpoint"
address="http://192.168.9.31:7001/services/AckService" 
    wsdlURL="http://192.168.9.31:7001/services/AckService?wsdl" 
    serviceName="ns2:AckService" endpointName="ns2:AckServiceEndpoint" 
    xmlns:ns2="http://ack.gateway.integration.abc.com">
    <cxf:properties>
      <entry key="dataFormat" value="PAYLOAD" />
    </cxf:properties>
  </cxf:cxfEndpoint>

But the problem that we are facing is when camel starts and the address is
not available then the following error is thrown -

2012-10-11 14:42:38,159 [ERROR]
org.springframework.web.context.ContextLoader - Context initialization
failed
org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint: Endpoint[cxf://bean:AckServiceEndpoint]. Reason:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.
  at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:389)
  at
org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:108)
  at
org.apache.camel.impl.ProducerCache.startProducer(ProducerCache.java:139)

Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Failed to create service.
  at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
  at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:398)
  at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:534)
  at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:248)

Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
Problem parsing 'http://192.168.9.31:7001/services/AckService?wsdl'.:
java.net.ConnectException: Tried all: '1' addresses, but could not connect
over HTTP to server: '192.168.9.31', port: '7001'
  at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
  at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

Caused by: java.net.ConnectException: Tried all: '1' addresses, but could
not connect over HTTP to server: '192.168.9.31', port: '7001'
  at weblogic.net.http.HttpClient.openServer(HttpClient.java:361)
  at weblogic.net.http.HttpClient.openServer(HttpClient.java:430)
  at weblogic.net.http.HttpClient.<init>(HttpClient.java:159)

Is there a way where in the connection is established on demand so that the
failures while real executions can be handled using error handlers rather
than camel failing to load altogether?




--
View this message in context: http://camel.465427.n5.nabble.com/Making-Camel-based-middle-layer-available-even-when-services-are-not-tp5720905.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message