I have built a Camel application that consumes from Kafka, calls a SOAP service and produces to Kafka.
Because of Camels automatic header transport between protocols (very useful), there were quite some unneeded message headers on Kafka messages and SOAP requests as well. Since I don't want to remove them from the Camel Exchange, I used Camels HeaderFilterStrategy
to remove them on outgoing messages only.
I extended Camels KafkaHeaderFilterStrategy
to filter the message headers on produced Kafka messages. I tried to do the same with CxfHeaderFilterStrategy
but that seems to filter only the SOAP headers while my SOAP requests contained all Kafka headers as HTTP headers.
Therefore I built a CXF out interceptor that filters the Map of Message.PROTOCOL_HEADERS
.
That works well, but I wonder if there is a "Camel way" to filter the HTTP headers of CXF SOAP messages.