本文整理汇总了Java中org.springframework.integration.transformer.support.HeaderValueMessageProcessor类的典型用法代码示例。如果您正苦于以下问题:Java HeaderValueMessageProcessor类的具体用法?Java HeaderValueMessageProcessor怎么用?Java HeaderValueMessageProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HeaderValueMessageProcessor类属于org.springframework.integration.transformer.support包,在下文中一共展示了HeaderValueMessageProcessor类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: headerEnricher
import org.springframework.integration.transformer.support.HeaderValueMessageProcessor; //导入依赖的package包/类
@Bean
public HeaderEnricher headerEnricher() {
return new HeaderEnricher(Collections.singletonMap(SimpMessageHeaderAccessor.SESSION_ID_HEADER, new HeaderValueMessageProcessor<String>() {
@Override
public String processMessage(Message<?> message) {
return message.getPayload().toString();
}
@Override
public Boolean isOverwrite() {
return Boolean.TRUE;
}
}));
// new
// ExpressionEvaluatingHeaderValueMessageProcessor<Object>("payload",
// null)));
}
开发者ID:gfoster-pivotal,项目名称:spring-streaming-processing,代码行数:19,代码来源:SpringIntegrationConfiguration.java
示例2: arrayToListProcessor
import org.springframework.integration.transformer.support.HeaderValueMessageProcessor; //导入依赖的package包/类
private HeaderValueMessageProcessor<?> arrayToListProcessor(final String header) {
return new AbstractHeaderValueMessageProcessor<List<String>>() {
@Override
public List<String> processMessage(Message<?> message) {
return Arrays.asList(message.getHeaders().get(header, String[].class));
}
};
}
示例3: enrichSpamHeader
import org.springframework.integration.transformer.support.HeaderValueMessageProcessor; //导入依赖的package包/类
@Bean
@Transformer(inputChannel = "messageSpamTransfer", outputChannel = "messageOutput")
public HeaderEnricher enrichSpamHeader() {
Map<String, ? extends HeaderValueMessageProcessor<?>> headersToAdd = Collections.singletonMap("SPAM", new StaticHeaderValueMessageProcessor<>(Boolean.TRUE));
HeaderEnricher enricher = new HeaderEnricher(headersToAdd);
return enricher;
}