It seems that I ran into a little problem when using @Autowired in a custom cxf interceptor. My use case is that I want to register soap messages and send them using AMQP to another system. This process works for regular services, etc. But no matter what I do, the required properties are not transferred automatically and remain null.
I checked the Spring DI log and the context is scanned and selected, so what am I missing?
Is this 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 {
amqpTemplate.convertAndSend(binding, buffer.toString());
}
}
Marco source
share