Hello,

I'm trying to consume messages from a seda component with multiple threads.
Those String-based messages are lines coming from a flat file that I want to
parse with the FlatPack component/marshaller. [Later on, those Java
Map-based messages will be converted into Entities and persisted with the
Camel JPA Component, and keeping the multithreaded approach should improve
performance of the overhaul file processing]

On a mono-thread usage, every thing works fine, but when I set a number of
threads (greater than 1) in my route (as in the DSL below):

from("seda:dataintegration.filtered.elements")
        .threads(1, 10) 
        .unmarshal(df)
        .convertBodyTo(PointOfInterest.class)
        .to("seda:dataintegration.unmarshalled.elements");
 
... things start going bad (see the stacktraces below). 

Failed delivery for exchangeId: 2d044b8f-0658-43af-897b-05c7ac557b81.
Exhausted after delivery attempt: 1 caught:
org.apache.camel.InvalidPayloadException: No body available of type:
x.y.z.PointOfInterest but has value: [{...}] of type:
org.apache.camel.component.flatpack.DataSetList on: Message: [{...}].
Exchange[Message: [{...}]]
org.apache.camel.InvalidPayloadException: No body available of type: 
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type:
org.apache.camel.component.flatpack.DataSetList to the required type:
x.y.z.PointOfInterest with value [{...}]]
        at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:103)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        at
org.apache.camel.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:57)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        ...
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[na:1.6.0_12]
        at java.lang.Thread.run(Thread.java:619) [na:1.6.0_12]
Caused by: org.apache.camel.NoTypeConversionAvailableException: No type
converter available to convert from type:
org.apache.camel.component.flatpack.DataSetList to the required type:
x.y.z.PointOfInterest with value [{...}]
        at
org.apache.camel.impl.converter.DefaultTypeConverter.mandatoryConvertTo(DefaultTypeConverter.java:128)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        at
org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        ... 32 common frames omitted
Caused by: org.apache.camel.RuntimeCamelException:
java.lang.NumberFormatException: multiple points
        at 
org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:823)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        at
org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:50)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        at
org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:171)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        at
org.apache.camel.impl.converter.DefaultTypeConverter.mandatoryConvertTo(DefaultTypeConverter.java:126)
~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
        ... 33 common frames omitted
Caused by: java.lang.NumberFormatException: multiple points
        at 
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1084)
~[na:1.6.0_12]
        at java.lang.Double.parseDouble(Double.java:510) ~[na:1.6.0_12]
        at java.text.DigitList.getDouble(DigitList.java:151) ~[na:1.6.0_12]
        at java.text.DecimalFormat.parse(DecimalFormat.java:1303) ~[na:1.6.0_12]
        at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1936)
~[na:1.6.0_12]
        at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1312)
~[na:1.6.0_12]
        at java.text.DateFormat.parse(DateFormat.java:335) ~[na:1.6.0_12]

Is the FlatPack component thread-safe ? 


Thank you in advance
Best regards,

Xavier
        
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problems-with-multiple-threads-on-FlatPack-component-tp3376267p3376267.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to