I wish to develop a generic java bean that will be included in all my camel routes (for personalized logging purposes). The route will call my java function in a processor and pass it the exchange object (and other stuff if needed).
How can I detect the type of the first endpoint that the route listens to ? it can be from ftp, http, jms etc ... and the relevant informations I would like to log are in different headers according to the endpoint protocol, for instance "CamelFileName" for ftp.
I have a workaround testing if the "CamelFilename" header exists then I know the endpoint listens to ftp server, or I could parse the endpointURI, but is there a more reliable/seeded function to get this?