org.springframework.integration.annotation.Filter Java Examples
The following examples show how to use
org.springframework.integration.annotation.Filter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UdpServer.java From ProjectStudy with MIT License | 6 votes |
/** * 过滤器 * * @param message * @param headers * @return boolean * @throws * @author wliduo[[email protected]] * @date 2020/5/20 15:30 */ @Filter(inputChannel = "udpFilter", outputChannel = "udpRouter") public boolean filter(String message, @Headers Map<String, Object> headers) { // 获取来源Id String id = headers.get("id").toString(); // 获取来源IP,可以进行IP过滤 String ip = headers.get("ip_address").toString(); // 获取来源Port String port = headers.get("ip_port").toString(); // 信息数据过滤 /*if (message.indexOf("-") < 0) { // 没有-的数据会被过滤 return false; }*/ return true; }
Example #2
Source File: FilterService.java From rocketmq-binder-demo with Apache License 2.0 | 5 votes |
@Filter(inputChannel = Sink.INPUT, discardChannel = FilterApplication.DISCARD_INPUT, outputChannel = FilterApplication.SUCCESS_INPUT) public boolean receiveByFilter(String receiveMsg) { String[] msgInfo = receiveMsg.split("-"); if (Integer.parseInt(msgInfo[1]) % 2 == 0) { return true; } return false; }
Example #3
Source File: GroovyFilterProcessorConfiguration.java From spring-cloud-stream-app-starters with Apache License 2.0 | 4 votes |
@Bean @Filter(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) public MessageProcessor<?> filter() { return new GroovyScriptExecutingMessageProcessor( new ResourceScriptSource(this.properties.getScript()), this.scriptVariableGenerator); }
Example #4
Source File: FilterProcessorConfiguration.java From spring-cloud-stream-app-starters with Apache License 2.0 | 4 votes |
@Filter(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) public boolean filter(Message<?> message) { return this.properties.getExpression().getValue(message, Boolean.class); }