私は春の統合プロジェクト (1.0.2) に取り組んでおり、@Header アノテーションを機能させることができません。
これが私のサービスアクティベーターです:
@Component
public class MyTransformer {
@ServiceActivator(inputChannel = "inChannel", outputChannel = "outChannel")
public String transform(final Message<?> message,
@Header(value = "eventId") final Long id,
@Header(value = "error", required = false) final Throwable throwable) {
return throwable == null
? "event [" + eventId +"]"
: "event [" + eventId +"] error: " + throwable.getMessage();
}
}
エラーメッセージは次のとおりです。
Caused by: java.lang.IllegalArgumentException: Wrong number of arguments. Expected types {class java.lang.Object, class java.lang.Long, class java.lang.Throwable}, but received values {[Payload=parp][Headers={eventId=888Foo, error=java.lang.IllegalArgumentException: Invalid message content parp, springintegration_timestamp=1277803938244, springintegration_id=726d0769-bd27-4d95-a9ea-640c1f807065}]}.
at org.springframework.integration.util.DefaultMethodInvoker.invokeMethod(DefaultMethodInvoker.java:71)
at org.springframework.integration.handler.MessageMappingMethodInvoker.doInvokeMethod(MessageMappingMethodInvoker.java:160)
at org.springframework.integration.handler.MessageMappingMethodInvoker.invokeMethod(MessageMappingMethodInvoker.java:107)
at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:49)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:91)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:59)
私は何を間違っていますか?