Beispiel #1
0
 public void process(Exchange exchange) throws Exception {
   if (endpoint.getConsumer() == null) {
     LOG.warn("No consumers available on endpoint: " + endpoint + " to process: " + exchange);
     throw new DirectConsumerNotAvailableException(
         "No consumers available on endpoint: " + endpoint, exchange);
   } else {
     endpoint.getConsumer().getProcessor().process(exchange);
   }
 }
Beispiel #2
0
  public boolean process(Exchange exchange, OptionalAsyncResultHandler optionalAsyncResultHandler)
      throws Exception {
    if (endpoint.getConsumer() == null) {
      LOG.warn("No consumers available on endpoint: " + endpoint + " to process: " + exchange);
      // indicate its done synchronously
      exchange.setException(
          new DirectConsumerNotAvailableException(
              "No consumers available on endpoint: " + endpoint, exchange));
      optionalAsyncResultHandler.done(exchange);
      return true;
    } else {
      AsyncProcessor processor =
          AsyncProcessorConverterHelper.convert(endpoint.getConsumer().getProcessor());

      return processor.process(exchange, optionalAsyncResultHandler);
    }
  }