Problem with catch exception in route calling job

One Star

Problem with catch exception in route calling job

Hi,
let me explain my problem : i've got a route begining with a WS Rest, then calling a cTalendJob, and finally putting the message in a jms queue. The job called by the route is a simple insert of the message in a database with a stored procedure (tOracleSP). I want to catch exceptions in the whole process so i put a try/catch(Exception.class) in the route just before the cTalendJob.
When a message is received, it is stored in DB and put in the queue => OK.
When an error occur for example because of a primary key violation in DB storing, the 'catch' route is used and the error is correctly handled => OK.
But after an error, all following messages are handled as errors in the route, even if they are well stored in DB => KO !
How can i reinitilize the error context after an error ?
Thank you for helping.
Community Manager

Re: Problem with catch exception in route calling job

what about using a cOnException component :
https://help.talend.com/search/all?query=cOnException&content-lang=en
HTH
One Star

Re: Problem with catch exception in route calling job

Thank you for your answer. But i have the same behavior with cOnException : after the first unique constraint violation, cOnException catch all messages... do my problem come from the job ?
For further explanations, my job begin with a tRouteInput, then a tJDBCSP to insert the message in DB, then a tXMLMap to get the technical identifier, and finally a tRouteOutput. Besides, i put a tAssertCatcher + tMap +tRouteOutput to set header properties relative to the error.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read