You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "anish.somadevan" <ne...@gmail.com> on 2015/07/27 21:47:52 UTC

Basic Camel Route XML for accessing Google.com

Am fairly new to Camel and i would like to understand what will be the route
XML to access Google.com and get the response headers to understand if its a
success or failure.

I have set up my route-outbound XML as given below,

<routes xmlns="http://camel.apache.org/schema/spring">

       <route id="testroute">
        <from uri="Myapplication" />
        <setProperty propertyName="counter">
            <groovy>1</groovy>
        </setProperty>
        <to uri="https://www.google.com" />
        <log message="********Trying to access Google website*******"
loggingLevel="INFO" />
		<choice>
            <when>
                <simple>${in.headers} contains '200'</simple>
                <log message="*****Connection established*****"
loggingLevel="INFO"/>
                <to uri="https://portal.env1.acp.aws.accenture.com" />
            </when>
            <when>
                <groovy>exchange.getProperty('counter') >= 5</groovy>

                <log message="********Ending execution as max retries has
been reached*********" loggingLevel="INFO"/>
                <to uri="Myapplication" />
            </when>
        </choice>
        <onException>
            <exception>java.lang.Exception</exception>
            <handled>
                <constant>true</constant>
            </handled>
            <to uri="bean:exceptionProcessor"/>
            <to uri="Myapplication" />
            <stop/>
        </onException>
    </route>

   </routes>

Can anyone please let me know if this is right?

Thanks,
Anish



--
View this message in context: http://camel.465427.n5.nabble.com/Basic-Camel-Route-XML-for-accessing-Google-com-tp5769985.html
Sent from the Camel Development mailing list archive at Nabble.com.