java - How to deal with DirectVmConsumerNotAvailableException -
i have camel based application direct-vm routes, directvmconsumernotavailableexceptions after redeployment our continuous integration server. redeployment done using karaf's commands:
features:uninstall my-feature/snapshot-version features:removeurl mvn:my-package/my-feature/snapshot-version/xml/features features:addurl mvn:my-package/my-feature/snapshot-version/xml/features features:install my-feature/snapshot-version my feature consists of several bundles, broken direct-vm route between 2 of them.
is there way how automatically reconnect from/to direct-vm route? there better way how redeploy camel application? there way how detect broken routes before used?
since camel 2.16 there option failifnoconsumers can set false, if ok you, have failing exchanges, appear @ startup, when bundle, defining route not yet loaded, other bundle, using endpoint is. disadvantage is, during normal use, errors not acceptable , need handling.
i had same problem once (prior 2.16), , wrote custom error handler, checks on directvmconsumernotavailableexception, if occurred during startup, , silently discards exchange.
if know route, initializes direct-vm endpoint , have access camelcontext, point, exception occurs, can check camelcontext.getroutestatus(string id), if route , running...
Comments
Post a Comment