I am attempting to create a re-usable route for SQL errors. Based upon the 
SQLErrorLevel I want to write an Error, Warning, or Info message out.  I can 
set the LoggingLevel in the Header but I have figured out anyway to get it back 
out and use it. The closes I've come is 
simple("${header.LoggingLevel}").evaluate( <what can I put here>", 
String.class)) but I can't figure out how to get it to use the current exchange.

.choice()
        .when().simple("${header.SQLErrorLevel} =~ 'info'")
                
.setHeader("LoggingLevel").simple("${type:org.apache.camel.LoggingLevel.INFO}")
        .endChoice()
        .when().simple("${header.SQLErrorLevel} =~ 'warn'")
                
.setHeader("LoggingLevel").simple("${type:org.apache.camel.LoggingLevel.WARN}")
        .endChoice()
        .otherwise()
                
.setHeader("LoggingLevel").simple("${type:org.apache.camel.LoggingLevel.ERROR}")
        .endChoice()
.end()  
  
.log(LoggingLevel.valueOf(simple("${header.LoggingLevel}").evaluate( <what can 
I put here>", String.class)),"* --> SQLErrorNumber: ${header.SQLErrorNumber}")

Regards-
Marci Wilken
She/Her/Hers
 


Reply via email to