Hi

See
https://camel.apache.org/dead-letter-channel.html

about which endpoint failed.


On Mon, Mar 17, 2014 at 3:48 AM, moj0002 <mortenjensenh...@hotmail.com> wrote:
> I am trying to write a simple "ping" application. I ping urls in a multicast
> and if there is a connection exception I catch it in a onException which
> calls a aggregation that builds an email
>
> If myFirstURLToPing is down I can't figure out out how to pass the URL via
> the Exception to the email body.
>
> I can't find something like ${to.uri} in the Message or Exchange. This seems
> that it should be easy to get from the exception but I can't find any
> references to the uri variable.
>
> <route >
>             <from uri="timer://foo?fixedRate=true&period=3600000"
> id="pingTine"/>
>             <multicast>
>                 <to http://myFirstURLToPing:1234"; />
>                 <to http://mySecondURLToPing:1234"; />
>                 <to http://myThirdURLToPing:1234"; />
>
>             </multicast>
>  </route>
>
>
> <onException useOriginalMessage="true">
>             <exception>java.net.ConnectException</exception>
>             <exception>java.net.UnknownHostException</exception>
>             <handled>
>                 <constant>true</constant>
>             </handled>
>             <transform>
>                 <simple>DOWN  >>>  <HERE  SHOLD the URI BE
> DISPLAYED></simple>
>             </transform>
>            <to uri="direct:buildEmaiBody"/>
> </onException>
>
>
> <route>
> <from uri="direct:buildEmaiBody"/>
> <aggregate strategyRef="mailBodyAppender" strategyMethodName="append"
> completionTimeout="20000">
> <correlationExpression>
>    <constant>true</constant>
>  </correlationExpression>
>  <to smpt://.../>
>   </aggregate>
> </route>
>
> I would want my email to show
>
> DOWN  >>> http://myFirstURLToPing:1234
> DOWN  >>> http://myThirdURLToPing:1234
>
> I have figured out a way by creating a route for each URL to ping, naming
> the route the same as the URL to ping and then use ${routeId} but that seems
> very clumpsy
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/retrieving-iru-in-onException-tp5748904.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to