File tree Expand file tree Collapse file tree
src/main/java/org/mifos/processor/bulk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,10 +44,11 @@ public void configure() throws Exception {
4444 ObjectMapper objectMapper = new ObjectMapper ();
4545 String jsonString = objectMapper .writeValueAsString (body );
4646 exchange .getIn ().setBody (jsonString );
47- }).setHeader (Exchange .HTTP_METHOD , constant ("POST" ))
47+ }).choice (). when ( exchangeProperty ( "X-CallbackURL" ). isNotNull ()). setHeader (Exchange .HTTP_METHOD , constant ("POST" ))
4848 .toD ("${exchangeProperty.X-CallbackURL}?bridgeEndpoint=true&throwExceptionOnFailure=false" )
49- .log (LoggingLevel .INFO , "Callback Response body: ${body}" ).choice ()
50- .when (header (Exchange .HTTP_RESPONSE_CODE ).regex ("^2\\ d{2}$" )).log (LoggingLevel .INFO , "Callback sending was successful" )
49+ .log (LoggingLevel .INFO , "Callback Response body: ${body}" ).endChoice ().otherwise ()
50+ .log ("Unable to send callback: callback url is null" ).choice ().when (header (Exchange .HTTP_RESPONSE_CODE ).regex ("^2\\ d{2}$" ))
51+ .when (exchangeProperty ("X-CallbackURL" ).isNotNull ()).log (LoggingLevel .INFO , "Callback sending was successful" )
5152 .process (exchange -> {
5253 List phases = exchange .getProperty (PHASES , List .class );
5354 exchange .setProperty (CALLBACK_RESPONSE_CODE , exchange .getIn ().getHeader (Exchange .HTTP_RESPONSE_CODE ));
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public void setup() {
5252 String registeringInstituteId = variables .get (REGISTERING_INSTITUTE_ID ).toString ();
5353 logger .info ("registeringInstituteId in worker {}" , registeringInstituteId );
5454 variables .put (CACHED_TRANSACTION_ID , job .getKey ());
55- exchange .setProperty (HEADER_REGISTERING_INSTITUTE_ID , registeringInstituteId ) ;
55+ exchange .setProperty (HEADER_REGISTERING_INSTITUTE_ID , registeringInstituteId );
5656 exchange .setProperty (SERVER_FILE_NAME , filename );
5757 exchange .setProperty (REQUEST_ID , job .getKey ());
5858 exchange .setProperty (CALLBACK , identityMapperURL + batchAccountLookupCallback );
You can’t perform that action at this time.
0 commit comments