@ Path ( "batch" ) @ POST public Response batchReplication ( ReplicationList replicationList ) { try { ReplicationListResponse batchResponse = new ReplicationListResponse ( ) ; for ( ReplicationInstance instanceInfo : replicationList . getReplicationList ( ) ) { try { batchResponse . addResponse ( dispatch ( instanceInfo ) ) ; } catch ( Exception e ) { batchResponse . addResponse ( new ReplicationInstanceResponse ( Status . INTERNAL_SERVER_ERROR . getStatusCode ( ) , null ) ) ; logger . error ( "{} request processing failed for batch item {}/{}" , instanceInfo . getAction ( ) , instanceInfo . getAppName ( ) , instanceInfo . getId ( ) , e ) ; } } return Response . ok ( batchResponse ) . build ( ) ; } catch ( Throwable e ) { logger . error ( "Cannot execute batch Request" , e ) ; return Response . status ( Status . INTERNAL_SERVER_ERROR ) . build ( ) ; } }
Process batched replication events from peer eureka nodes .