public void writeContent(HttpCarbonMessage httpOutboundRequest) {
        if (handlerExecutor != null) {
            handlerExecutor.executeAtTargetRequestReceiving(httpOutboundRequest);
        }
        BackPressureHandler backpressureHandler = Util.getBackPressureHandler(targetHandler.getContext());
        Util.setBackPressureListener(httpOutboundRequest, backpressureHandler, httpOutboundRequest.getSourceContext());
        resetTargetChannelState();
        httpOutboundRequest.getHttpContentAsync().setMessageListener((httpContent -> {
            //TODO:Until the listener is set, content writing happens in I/O thread. If writability changed
            //while in I/O thread and DefaultBackPressureListener is engaged, there's a chance of I/O thread
            //getting blocked. Cannot recreate, only a possibility.
            Util.checkUnWritabilityAndNotify(targetHandler.getContext(), backpressureHandler);
            this.channel.eventLoop().execute(() -> {
                try {
                    senderReqRespStateManager.writeOutboundRequestEntity(httpOutboundRequest, httpContent);
                } catch (Exception exception) {
                    String errorMsg = "Failed to send the request : "
                            + exception.getMessage().toLowerCase(Locale.ENGLISH);
                    LOG.error(errorMsg, exception);
                    this.targetHandler.getHttpResponseFuture().notifyHttpListener(exception);
                }
            });
        }));
    }
public void writeContent(HttpCarbonMessage httpOutboundRequest) {
        if (handlerExecutor != null) {
            handlerExecutor.executeAtTargetRequestReceiving(httpOutboundRequest);
        }
        BackPressureHandler backpressureHandler = Util.getBackPressureHandler(targetHandler.getContext());
        Util.setBackPressureListener(httpOutboundRequest, backpressureHandler, httpOutboundRequest.getSourceContext());
        resetTargetChannelState();
        httpOutboundRequest.getHttpContentAsync().setMessageListener((httpContent -> {
           
           
           
            Util.checkUnWritabilityAndNotify(targetHandler.getContext(), backpressureHandler);
            this.channel.eventLoop().execute(() -> {
                try {
                    senderReqRespStateManager.writeOutboundRequestEntity(httpOutboundRequest, httpContent);
                } catch (Exception exception) {
                    String errorMsg = "Failed to send the request : "
                            + exception.getMessage().toLowerCase(Locale.ENGLISH);
                    LOG.error(errorMsg, exception);
                    this.targetHandler.getHttpResponseFuture().notifyHttpListener(exception);
                }
            });
        }));
    }
public void writecontent(httpcarbonmessage httpoutboundrequest) { if (handlerexecutor != null) { handlerexecutor.executeattargetrequestreceiving(httpoutboundrequest); } backpressurehandler backpressurehandler = util.getbackpressurehandler(targethandler.getcontext()); util.setbackpressurelistener(httpoutboundrequest, backpressurehandler, httpoutboundrequest.getsourcecontext()); resettargetchannelstate(); httpoutboundrequest.gethttpcontentasync().setmessagelistener((httpcontent -> { util.checkunwritabilityandnotify(targethandler.getcontext(), backpressurehandler); this.channel.eventloop().execute(() -> { try { senderreqrespstatemanager.writeoutboundrequestentity(httpoutboundrequest, httpcontent); } catch (exception exception) { string errormsg = "failed to send the request : " + exception.getmessage().tolowercase(locale.english); log.error(errormsg, exception); this.targethandler.gethttpresponsefuture().notifyhttplistener(exception); } }); })); }