@ Override public void handleResponseFromServiceToHttpResponse ( final Response < Object > response , final HttpRequest originatingRequest ) { final String key = Str . add ( "" + originatingRequest . id ( ) , "|" , originatingRequest . returnAddress ( ) ) ; this . outstandingRequestMap . remove ( key ) ; if ( response . wasErrors ( ) ) { handleError ( response , originatingRequest ) ; } else { if ( response . body ( ) instanceof HttpResponse ) { writeHttpResponse ( originatingRequest . getReceiver ( ) , ( ( HttpResponse ) response . body ( ) ) ) ; } else { final RequestMetaData requestMetaData = metaDataProviderMap . get ( RequestMethod . valueOf ( originatingRequest . getMethod ( ) ) ) . get ( originatingRequest . address ( ) ) ; final ServiceMethodMeta serviceMethodMeta = requestMetaData . getMethod ( ) ; final int responseCode = serviceMethodMeta . getResponseCode ( ) ; MultiMap < String , String > headers = response . headers ( ) ; if ( requestMetaData . getRequest ( ) . hasResponseHeaders ( ) ) { if ( response . headers ( ) == MultiMap . EMPTY ) { headers = new MultiMapImpl <> ( ) ; } else { headers = response . headers ( ) ; } headers . putAllCopyLists ( requestMetaData . getRequest ( ) . getResponseHeaders ( ) ) ; } writeResponse ( originatingRequest . getReceiver ( ) , responseCode == - 1 ? HttpStatus . OK : responseCode , serviceMethodMeta . getContentType ( ) , jsonMapper . toJson ( response . body ( ) ) , headers ) ; } } }
2nd MOST IMPORTANT METHOD FOR DEBUGGING WHY SOMETHING IS NOT CALLED .