• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Get Failed Node Endpoint URI in Camel route

Resolved: Get Failed Node Endpoint URI in Camel route

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am developing a sample route
  1. FROM: SOURCE ENDPOINT URI
  2. TO: TRANS ENDPOINT URI // Error or Exception occurred at this TRANS endpoint
  3. TO: TARGET ENDPOINT URI

Now I want to catch the Error Occured endpoint and pass it to my processor.
Could anyone please help me with this?


Answer:

You can use exchange properties:
  • CamelFailureEndpoint
    • example xml-dsl: <exchangeProperty>CamelFailureEndpoint</exchangeProperty>
    • example java: exchange.getProperty(Exchange.FAILURE_ENDPOINT, String.class);
  • CamelToEndpoint
    • example xml-dsl: <exchangeProperty>CamelToEndpoint</exchangeProperty>
    • example java: exchange.getProperty(Exchange.TO_ENDPOINT, String.class)

The first one should print uri for the consumer endpoint (from) that failed and the second one should show the previously called producer (to) endpoint.
One handy way to debug contexts of an failed exchange is to use:
  • <to uri="log:loggerName?showAll=true" />

This will log all exchange properties, headers, body and exception which can help to understand what information is available within exchange. Be careful where you use it as it might also log secrets and passwords if they’re within the exchange so better use it only locally during development.
For more information you’d probably need to access CamelMessageHistory exchange property through processor, bean or something.

If you have better answer, please add a comment about this, thank you!

apache-camel
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: I am facing ERR_HTTP2_PROTOCOL_ERROR on my website

27/03/2023

Resolved: TypeScript does not recognize properties when instantiating interface array

27/03/2023

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.