protected boolean isNonBlocking(MuleEvent event) { return event.isAllowNonBlocking() && event.getReplyToHandler() != null; }
protected boolean isNonBlocking(MuleEvent event) { return event.getFlowConstruct() instanceof Flow && event.isAllowNonBlocking() && event.getReplyToHandler() != null; }
private boolean isNonBlocking(MuleEvent event) { return event.getFlowConstruct() instanceof Flow && event.isAllowNonBlocking() && event.getReplyToHandler() != null && isSupportsNonBlocking() && !endpoint.getTransactionConfig().isTransacted(); }
public ProcessorExecutor createProcessorExecutor(MuleEvent event, List<MessageProcessor> processors, MessageProcessorExecutionTemplate executionTemplate, boolean copyOnVoidEvent) { if (event.isAllowNonBlocking()) { return new NonBlockingProcessorExecutor(event, processors, executionTemplate, copyOnVoidEvent); } else if (event.getFlowConstruct() instanceof Service) { return new ServiceProcessorExecutor(event, processors, executionTemplate, copyOnVoidEvent); } else { return new BlockingProcessorExecutor(event, processors, executionTemplate, copyOnVoidEvent); } }
@Override protected MuleEvent processResponse(MuleEvent response, MuleEvent request) throws MuleException { processOutboundRouterStatistics(flowConstruct); response = afterRouting(exception, response); if (response != null && !VoidMuleEvent.getInstance().equals(response)) { // Only process reply-to if non-blocking is not enabled. Checking the exchange pattern is not sufficient // because JMS inbound endpoints for example use a REQUEST_RESPONSE exchange pattern and async processing. if (!(request.isAllowNonBlocking() && request.getReplyToHandler() instanceof NonBlockingReplyToHandler)) { processReplyTo(response, exception); } closeStream(response.getMessage()); nullifyExceptionPayloadIfRequired(response); } return response; }
if (event.isAllowNonBlocking() && event.getReplyToHandler() != null)
req.setOutboundProperty(HttpConnector.HTTP_DISABLE_STATUS_CODE_EXCEPTION_CHECK, Boolean.TRUE.toString()); if (reqEvent.isAllowNonBlocking())
@Override protected void preProcess(MessageProcessor processor) { if (event.isAllowNonBlocking()) { if (!processorSupportsNonBlocking(processor)) { fallbackWarning.warn(processor.getClass()); // Make event synchronous so that non-blocking is not used event = new DefaultMuleEvent(event, event.getFlowConstruct(), event.getReplyToHandler(), event.getReplyToDestination(), true); // Update RequestContext ThreadLocal for backwards compatibility OptimizedRequestContext.unsafeSetEvent(event); } if (processor instanceof NonBlockingMessageProcessor) { // Even if there is no ReplyToHandler available, using non-blocking processing anyway for a non-blocking // message processor if a response isn't required. if (!(messageExchangePattern.hasResponse() && replyToHandler == null)) { event = new DefaultMuleEvent(event, new NonBlockingProcessorExecutorReplyToHandler()); // Update RequestContext ThreadLocal for backwards compatibility OptimizedRequestContext.unsafeSetEvent(event); } } } }
@Override public MuleEvent process() throws Exception { MuleEvent muleEvent = template.getMuleEvent(); fireNotification(muleEvent, MESSAGE_RECEIVED); if (muleEvent.isAllowNonBlocking()) { muleEvent = new DefaultMuleEvent(muleEvent, new ExceptionHandlingReplyToHandlerDecorator(new FlowProcessingNonBlockingReplyToHandler(template, phaseResultNotifier, exceptionHandler), messageProcessContext.getFlowConstruct().getExceptionListener())); // Update RequestContext ThreadLocal for backwards compatibility OptimizedRequestContext.unsafeSetEvent(muleEvent); } return template.routeEvent(muleEvent); } });
MessagingException exceptionThrown = null; boolean nonBlocking = event.isAllowNonBlocking() && event.getReplyToHandler() != null; boolean responseProcessing = messageProcessor instanceof InterceptingMessageProcessor || messageProcessor instanceof NonBlockingMessageProcessor;
this.notificationsEnabled = rewriteEvent.isNotificationsEnabled(); this.synchronous = synchronous; this.nonBlocking = rewriteEvent.isAllowNonBlocking() || isFlowConstructNonBlockingProcessingStrategy(); this.flowCallStack = rewriteEvent.getFlowCallStack() == null ? new DefaultFlowCallStack() : rewriteEvent.getFlowCallStack().clone();