> On Jun 12, 2015, at 11:26 AM, eddgrant <[email protected]> wrote: > > Thanks Dan, I have written a LoggingInterceptor subclass which does the job > nicely! > > I'm storing the request body in a ThreadLocal which I'm then accessing later > on in a DefaultValidationEventHandler subclass where I detect if validation > has failed. It feels a bit hacky but I haven't yet found a cleaner way to > pass my data around. > > I did see a suggestion of using the Exchange as a message passing mechanism > however I can't find a way to access the Exchange within > formatLoggingMessage(LoggingMessage loggingMessage). Any thoughts here?
You should be able to grab the current message via PhaseInterceptorChain.getCurrentMessage() and grab the exchange from there. That said, that’s just through a tread local as well. -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
