atlasmap-attic / atlasmap-runtime

AtlasMap runtime engine and design time services
http://atlasmap.io
Other
3 stars 8 forks source link

Tutorial requires using a Twitter account with a space in the Twitter Name #275

Closed igarashitm closed 6 years ago

igarashitm commented 6 years ago

From @apupier on November 2, 2017 12:54

otherwise this exception is thrown:

12:05:36.304 [Camel (Tuto) thread #1 - twitter-mention-connector-component://MENTIONS] ERROR io.atlasmap.core.BaseAtlasModule - Separate returned fewer segements count=1 when outputField.path=/LastName requested index=1
12:05:36.304 [Camel (Tuto) thread #1 - twitter-mention-connector-component://MENTIONS] ERROR io.atlasmap.core.DefaultAtlasContext - Aborting processing due to 1 errors
12:05:36.310 [Camel (Tuto) thread #1 - twitter-mention-connector-component://MENTIONS] ERROR o.a.c.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-tuto-2-2vbns-1509620794478-0-10 on ExchangeId: ID-tuto-2-2vbns-1509620794478-0-9). Exhausted after delivery attempt: 1 caught: io.atlasmap.api.AtlasException: Separate returned fewer segements count=1 when outputField.path=/LastName requested index=1

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[flow1             ] [flow1             ] [twitter-mention-connector-component://MENTIONS?delay=30000&sinceId=1          ] [      1008]
[flow1             ] [filter1           ] [filter[{io.syndesis.integration.runtime.util.JsonSimplePredicate@73894c5a}]   ] [         0]
[flow1             ] [to1               ] [atlas:mapping-step-3.json                                                     ] [       997]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
io.atlasmap.api.AtlasException: Separate returned fewer segements count=1 when outputField.path=/LastName requested index=1
    at org.apache.camel.component.atlasmap.AtlasEndpoint.onExchange(AtlasEndpoint.java:221)
    at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
    at org.apache.camel.processor.FilterProcessor.process(FilterProcessor.java:57)
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
    at org.apache.camel.component.twitter.consumer.DefaultTwitterConsumer.poll(DefaultTwitterConsumer.java:98)
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

the error is only in pod log, a normal user would not have access to it so it will silently fail from Fuse Ignite interface.

For TP2, it might be nice to add a note in the tutorial. For future, Keith is wondering:

if the mapper should simply not map indexes that are out of range vs. throwing an exception. This type of issue will be easier to self-diagnose when we have logging support directly in Ignite.

I guess both ways are valid depending on the usecase, so having the possibility to configure it would be even better.

Copied from original issue: syndesisio/syndesis-project#161

igarashitm commented 6 years ago

From @gashcrumb on November 2, 2017 13:17

We need a general solution for what to do with exchanges that cause an exception in the camel route, as these generally are going to require the user to figure out what to do with them.

I wonder for this case where you're splitting the string maybe we need some additional configuration available that lets the user specify that if the split fails it's okay and just stick the value into one of the target fields or if the split fails then an exception should be generated which would then cause the exchange to go into a dead letter queue kinda deal to be manually dealt with at some point.

igarashitm commented 6 years ago

This is a bug in atlasmap runtime, having inappropriate error level. Let's change this to WARN level, so that camel-atlasmap won't throw an Exception.

igarashitm commented 6 years ago

Also make sure COMBINE doesn't throw an error if any of source fields are not available, just warn.

apupier commented 6 years ago

For TP2, it might be nice to add a note in the tutorial.

Does the tutorial has been updated? Or you think that it is not necessary? or it is tracked somewhere else?