Hi there,

i seem to run into a small issue when using @Autowired into a custom
cxf interceptor.
My use case is that i want to log soap messages and send these using
AMQP to another system. This process works for normal services etc.
I checked the Spring DI log and the context is scanned and pickedup,
so what am i missing?

Is this even possible in CXF interceptors?

@Component
public class LogInInterceptor extends AbstractSoapInterceptor {

    private @Value("#{rabbitMQProperties['rabbitmq.binding.log.soap']}")
    String binding;

    @Autowired
    AmqpTemplate amqpTemplate;

    public LogInInterceptor() {
        super(Phase.RECEIVE);
    }

    @Override
    public void handleMessage(SoapMessage soapMessage) throws Fault {
        logIt(soapMessage);
    }

    private void logIt(SoapMessage message) throws Fault {
        // rest of the code omitted...!!!
        amqpTemplate.convertAndSend(binding, buffer.toString());
    }

}

Reply via email to