Two systems are talking to each other through integration(Using apache-camel). Let say system A needs to submit a request to System B which has exposed a web service to receive data and integration is transforming data as per system B web service.
In above scenario A and B has to be available same time and A will have to wait for response from B. I need to remove this dependency by putting queue at integration layer and with Async communication. Ex:
<camel:route id="AtoIntegration">
<camel:from
uri="spring-ws:someEndPoint" />
<camel:bean ref="testAsyncPreprocessor" />
<camel:inOnly uri="activemq:requestqueue" />
</camel:route>
<camel:route id="integrationToB">
<camel:from uri="activemq:requestqueue" />
<camel:transacted />
<camel:bean ref="afterQueueProcessor" />
<camel:setHeader headerName="CamelHttpMethod">
<camel:constant>POST</camel:constant>
</camel:setHeader>
<camel:setHeader headerName="Content-Type">
<camel:constant>application/x-www-form-urlencoded</camel:constant>
</camel:setHeader>
<camel:to uri="http://localhost:8080/systemB/newOrder?test=testData"
/>
</camel:route>
As per above routing system A can submit request even if system B is not available but route integrationToB still needs system B to be available else it will fail and put request to Dead Letter Queue after retry. So i'm trying to figure out how i can configure route integrationToB only run if system B is available.