本文整理汇总了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());
}
示例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());
}
示例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"));
}
示例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());
}
示例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;
}
示例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"));
}
示例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"));
}
示例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());
}
示例9: clearMetricsHeaders
import org.apache.camel.Message; //导入方法依赖的package包/类
protected boolean clearMetricsHeaders(Message in) {
return in.removeHeaders(HEADER_PATTERN);
}