Hi,
I tried to use the @Header annotation together with a boolean (primitive) in my service activator.
But in my multi-threaded import I get about 0-3 failures on every run (about 3000 messages). I have four cores in my machine.Code:@Override @ServiceActivator public final void processBusinessObject(final T businessObject, @Header("invalidation") final boolean invalidation) { ... }
But when I changed my code to use the wrapper Boolean everything runs without any problem.Code:Caused by: java.lang.IllegalArgumentException: Wrong number of arguments. Expected types {class xxx.messages.AbstractWarehouseAwareBusinessObject, boolean}, but received values {[Payload=xxx.messages.VariantAvailabilityBusinessObject@118bbe2][Headers={UniqueTransactionID=b98f27b9-b9bc-4e7c-bf94-5fd7c9837af2, TransactionDST=unknown, springintegration_id=ea956b09-fc42-4252-9e40-b4c4d27f8583, TransactionType=BatchFile, springintegration_jms_redelivered=false, springintegration_jms_messageId=ID:3f27f598:35249c0020:12B7B639EDA, invalidation=false, springintegration_timestamp=1286265347849, TransactionDateTime=Tue Oct 05 09:55:47 CEST 2010, springintegration_jms_correlationId=Message 1, springintegration_file_originalFile=C:\Import\working\2010-10-05-09.55.47.b98f27b9-b9bc-4e7c-bf94-5fd7c9837af2.msg, SourceSystemName=batchedfile}]}. 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) ... 37 more
Any ideas?Code:@Override @ServiceActivator public final void processBusinessObject(final T businessObject, @Header("invalidation") final Boolean invalidation) { ... }


Reply With Quote
