【问题标题】:Spring Integration with Splunk与 Splunk 的 Spring 集成
【发布时间】:2015-05-19 12:10:42
【问题描述】:
我在 Spring Integration 中有一个问题要从 splunk 中检索数据。
我已经配置了一个带有非阻塞选项的 splunkInboundChannelAdapter 来从 splunk 中提取数据。我在 int-splunk:inbound-channel-adapter 的定义中的“搜索”属性中添加了一个查询。
我想从 splunk 获取结果到 java 类。您能否分享一下spring集成中有哪些方法可以完成这项任务。提前致谢。
【问题讨论】:
标签:
spring-integration
splunk
【解决方案1】:
抱歉,不清楚您要问什么。
SplunkPollingChannelAdapter 将List<SplunkEvent> 作为消息payload 填充到channel。您可以使用 POJO 方法引用订阅一些 <service-activator>,因此,接受 List<SplunkEvent> 作为 Java 代码中的方法参数。
从那里你可以做任何逻辑。由于您的 POJO 是 Spring bean,因此您可以注入任何服务/DAO 来处理您想要的数据。