[ 
https://issues.apache.org/jira/browse/CAMEL-16025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-16025.
---------------------------------
      Assignee: Claus Ibsen
    Resolution: Fixed

The consumer tread will now catch that exception and re-creating the cursor and 
keep running

> [camel-mongodb] ChangeStreams: Exception not gracefully handled
> ---------------------------------------------------------------
>
>                 Key: CAMEL-16025
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16025
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mongodb
>    Affects Versions: 3.7.0
>            Reporter: Dario Nuevo
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 3.10.0
>
>
> I'm a bit confused how it should be handled when an Exception happens during 
> the _watch()_ in _MongoDbChangeStreamsThread_.
> I observed that the Mongo Client throws an Exception if the collection the 
> _watch()_ is on is deleted (the whole collection) - it that case, this 
> exception is thrown:
> {code}
> Exception in thread "Camel (camel-1) thread #1 - mongodb://mongoConnection" 
> java.lang.NullPointerException
>       at 
> org.apache.camel.component.mongodb.MongoDbChangeStreamsThread.doRun(MongoDbChangeStreamsThread.java:74)
>       at 
> org.apache.camel.component.mongodb.MongoAbstractConsumerThread.run(MongoAbstractConsumerThread.java:68)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>       at java.base/java.lang.Thread.run(Thread.java:830)
> {code}
> After the exception, Camel keeps running, the route is still "started", but 
> no Changestreams _watch()_es are active - so we are in a strange state.
> Exceptions can happen quite often using changeStreams - I think it should be 
> documented how the user should handle this. Or if this is an error and the 
> changestream _watch()_ should be restarted, that should be fixed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to