org.apache.camel.Message.isFault()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.apache.camel.Message.isFault()方法的一些代码示例,展示了Message.isFault()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.isFault()方法的具体详情如下:
包路径:org.apache.camel.Message
类名称:Message
方法名:isFault

Message.isFault介绍

暂无

代码示例

代码示例来源:origin: org.apache.camel/camel-jms

protected Message createJmsMessage(Exchange exchange, org.apache.camel.Message camelMessage, Session session, CamelContext context) throws JMSException {
  Message answer = createJmsMessage(exchange, camelMessage.getBody(), camelMessage.getHeaders(), session, context);
  // special for transferFault
  boolean isFault = camelMessage.isFault();
  if (answer != null && isFault && endpoint != null && endpoint.isTransferFault()) {
    answer.setBooleanProperty(JmsConstants.JMS_TRANSFER_FAULT, true);
  }
  return answer;
}

代码示例来源:origin: org.apache.camel/camel-cxf

if (camelExchange.isFailed()) {
  org.apache.camel.Message camelMsg = camelExchange.hasOut() ? camelExchange.getOut() : camelExchange.getIn();
  if (camelMsg.isFault()) {
    t = camelMsg.getBody(Throwable.class);
  } else {

代码示例来源:origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-core

public void testFault(String endpoint) throws InterruptedException {
  mockOutput.expectedMessageCount(0);
  Exchange result = producerTemplate.request(endpoint, exchange -> exchange.getIn().setBody("blah"));
  assertEquals("failed", result.getOut().getBody());
  assertTrue(result.getOut().isFault());
  mockOutput.assertIsSatisfied();
}

代码示例来源:origin: org.apache.camel/camel-spring-integration

Exchange outExchange = getCamelTemplate().send(getCamelEndpointUri(), inExchange);
org.apache.camel.Message camelMsg = outExchange.hasOut() ? outExchange.getOut() : outExchange.getIn();
if (camelMsg.isFault()) {
  result = true;

代码示例来源:origin: org.apache.servicemix/servicemix-camel

public void onFailure(Exchange exchange) {
    MessageExchange me = JbiBinding.getMessageExchange(exchange);
    try {
      if (exchange.hasOut() && exchange.getOut().isFault()) {
        Fault fault = me.createFault();
        binding.copyFromCamelToJbi(exchange.getOut(), fault);
        if (isFaultCapable(me)) {
          me.setFault(fault);
          doSend(me);
        } else {
          // MessageExchange is not capable of conveying faults -- sending the information as an error instead
          fail(me, new FaultException("Fault occured for " + exchange.getPattern() + " exchange", me, fault));
        }
      } else {
        fail(me, binding.extractException(exchange));
      }
    } catch (MessagingException e) {
      logger.warn("Unable to send JBI MessageExchange after successful Camel route invocation: {}", me, e);
    } 
  }
}

代码示例来源:origin: org.apache.camel/camel-jms

setFault(that.isFault());

代码示例来源:origin: org.apache.camel/camel-mail

public void copyFrom(org.apache.camel.Message that) {
  // only do a deep copy if we need to (yes when that is not a mail message, or if the mapMailMessage is true)
  boolean needCopy = !(that instanceof MailMessage) || (((MailMessage) that).mapMailMessage);
  if (needCopy) {
    super.copyFrom(that);
  } else {
    // no deep copy needed, but copy message id
    setMessageId(that.getMessageId());
    setFault(that.isFault());
  }
  if (that instanceof MailMessage) {
    MailMessage mailMessage = (MailMessage) that;
    this.originalMailMessage = mailMessage.originalMailMessage;
    this.mailMessage = mailMessage.mailMessage;
    this.mapMailMessage = mailMessage.mapMailMessage;
  }
  // cover over exchange if none has been assigned
  if (getExchange() == null) {
    setExchange(that.getExchange());
  }
}

代码示例来源:origin: org.switchyard.components/switchyard-component-common-camel

if (camelExchange.hasOut() && bindingData.getMessage().isFault()) {

代码示例来源:origin: jboss-switchyard/components

if (camelExchange.hasOut() && bindingData.getMessage().isFault()) {

代码示例来源:origin: org.apache.camel/camel-jms

if (msg.isFault()) {

代码示例来源:origin: org.switchyard.components/switchyard-component-camel-switchyard

if (camelExchange.hasOut() && camelExchange.getOut().isFault()) {
} else if (camelExchange.getIn().isFault()) {
  camelFault = camelExchange.getIn().getBody();

代码示例来源:origin: jboss-switchyard/components

if (camelExchange.hasOut() && camelExchange.getOut().isFault()) {

相关文章