当前位置: 首页>>代码示例>>Java>>正文


Java Message.removeHeaders方法代码示例

本文整理汇总了Java中org.apache.camel.Message.removeHeaders方法的典型用法代码示例。如果您正苦于以下问题:Java Message.removeHeaders方法的具体用法?Java Message.removeHeaders怎么用?Java Message.removeHeaders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.camel.Message的用法示例。


在下文中一共展示了Message.removeHeaders方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRemoveHeadersWithWildcard

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersWithWildcard() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tack", "blaa");
    msg.setHeader("tock", "blaaa");

    assertEquals("bla", msg.getHeader("tick"));
    assertEquals("blaa", msg.getHeader("tack"));
    assertEquals("blaaa", msg.getHeader("tock"));

    msg.removeHeaders("t*");

    assertTrue(msg.getHeaders().isEmpty());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:DefaultMessageHeaderTest.java

示例2: testRemoveHeadersAllWithWildcard

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersAllWithWildcard() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tack", "blaa");
    msg.setHeader("tock", "blaaa");

    assertEquals("bla", msg.getHeader("tick"));
    assertEquals("blaa", msg.getHeader("tack"));
    assertEquals("blaaa", msg.getHeader("tock"));

    msg.removeHeaders("*");

    assertTrue(msg.getHeaders().isEmpty());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:DefaultMessageHeaderTest.java

示例3: testRemoveHeadersAllWithExclude

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersAllWithExclude() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tack", "blaa");
    msg.setHeader("tock", "blaaa");

    assertEquals("bla", msg.getHeader("tick"));
    assertEquals("blaa", msg.getHeader("tack"));
    assertEquals("blaaa", msg.getHeader("tock"));

    msg.removeHeaders("*", "tick", "tock", "toe");

    // new message headers
    assertEquals("bla", msg.getHeader("tick"));
    assertEquals(null, msg.getHeader("tack"));
    assertEquals("blaaa", msg.getHeader("tock"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:DefaultMessageHeaderTest.java

示例4: testRemoveHeadersWithNulls

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersWithNulls() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tack", "blaa");
    msg.setHeader("tock", "blaaa");
    msg.setHeader("taack", "blaaaa");

    assertEquals("bla", msg.getHeader("tick"));
    assertEquals("blaa", msg.getHeader("tack"));
    assertEquals("blaaa", msg.getHeader("tock"));
    assertEquals("blaaaa", msg.getHeader("taack"));

    msg.removeHeaders(null, null, null, null);

    assertFalse(msg.getHeaders().isEmpty());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:DefaultMessageHeaderTest.java

示例5: process

import org.apache.camel.Message; //导入方法依赖的package包/类
@Override
public boolean process(Exchange exchange, AsyncCallback callback) {
    try {
        Message message = exchange.hasOut() ? exchange.getOut() : exchange.getIn();
        message.removeHeaders(pattern, excludePattern);
    } catch (Exception e) {
        exchange.setException(e);
    }

    callback.done(true);
    return true;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:RemoveHeadersProcessor.java

示例6: testRemoveHeadersWithExclude

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersWithExclude() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tiack", "blaa");
    msg.setHeader("tiock", "blaaa");
    msg.setHeader("tiuck", "blaaaa");

    msg.removeHeaders("ti*", "tiuck", "tiack");

    assertEquals(2, msg.getHeaders().size());
    assertEquals("blaa", msg.getHeader("tiack"));
    assertEquals("blaaaa", msg.getHeader("tiuck"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:DefaultMessageHeaderTest.java

示例7: testRemoveHeadersWithWildcardInExclude

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersWithWildcardInExclude() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tack", "blaa");
    msg.setHeader("taick", "blaa");
    msg.setHeader("tock", "blaaa");

    msg.removeHeaders("*", "ta*");

    assertEquals(2, msg.getHeaders().size());
    assertEquals("blaa", msg.getHeader("tack"));
    assertEquals("blaa", msg.getHeader("taick"));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:DefaultMessageHeaderTest.java

示例8: testRemoveHeadersWithNonExcludeHeaders

import org.apache.camel.Message; //导入方法依赖的package包/类
public void testRemoveHeadersWithNonExcludeHeaders() {
    Message msg = new DefaultMessage();
    assertNull(msg.getHeader("foo"));

    msg.setHeader("tick", "bla");
    msg.setHeader("tack", "blaa");
    msg.setHeader("tock", "blaaa");

    msg.removeHeaders("*", "camels", "are", "fun");

    assertTrue(msg.getHeaders().isEmpty());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:DefaultMessageHeaderTest.java

示例9: clearMetricsHeaders

import org.apache.camel.Message; //导入方法依赖的package包/类
protected boolean clearMetricsHeaders(Message in) {
    return in.removeHeaders(HEADER_PATTERN);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:AbstractMetricsProducer.java


注:本文中的org.apache.camel.Message.removeHeaders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。