You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Dario Nuevo (Jira)" <ji...@apache.org> on 2021/01/12 13:38:00 UTC

[jira] [Created] (CAMEL-16025) [camel-mongodb] ChangeStreams: Exception not gracefully handled

Dario Nuevo created CAMEL-16025:
-----------------------------------

             Summary: [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


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)