Websphere Message Broker - FileInput 节点 - 标头值
我正在使用 Websphere Message Broker 处理 csv 文件并将数据放入消息队列中。该文件通过 FileInputNode 读入,通过 JavaCompute 节点(用于验证),然后通过消息映射将其映射到目标格式,然后传递到 JMSOutput 节点。
我遇到的问题是 csv 中的第一行有一个值,我需要将其添加到每个出站消息中(第一行是标题,因此不会输出到队列中)。我对如何执行此操作有点困惑,因为我看不到如何优雅地将第一行中的 a 值映射到所有后续行。
我尝试使用 JavaCompute 节点保存 LocalEnvironment 上的值,但这似乎在行之间丢失了(顺便说一句,我正在逐行处理文件,该文件是在 fileinput 节点上设置的,因此每个流都会传递整个流程)记录)。
任何有关如何实现这一目标的提示将不胜感激。
巴里
I am using Websphere Message Broker to process csv files and put the data onto a Message queue. The file is read in via a FileInputNode, passed through a JavaCompute node (for validation), then a message map that maps it to the the target format then onto a JMSOutput node.
The problem I have is that the first line in the csv has a single value that I need to add to each of the outbound messages (the first line is the header so is not output onto the queue). I am a little stuck on how to do this as I cannot see how I can elegantly map the a value from the first row onto all subsequent rows.
I have tried holding the value on the LocalEnvironment using the JavaCompute node, but this appears to be lost between rows (incidentally I am processing the file row by row, which is set on the fileinput node, so the whole flow is passed through for each record).
Any tips on how to achieve this would be appreciated.
Barry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是一个想法,但是如果您将值加载到流程中定义的共享变量中,则它不应该在流程的行/执行之间丢失,就像您的 LocalEnvironment 想法一样......非常简短的第一遍想法,因为我还没试过这个。
Just a thought, but if you load up the value into a SHARED variable defined in the flow, it should not be lost between rows / execution of the flow as in the case of your LocalEnvironment idea... really brief first pass idea as I've not tried this yet.