apache spark中是否有一个框架可以在JMS队列中发送消息? [英] Is there a framework in apache spark to send message in a JMS queue?
本文介绍了apache spark中是否有一个框架可以在JMS队列中发送消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用Apache Spark来处理数据库中的数据.当我检测到特定行为时,我想触发一个事件(例如警报)来通知某些用户.一种方法是提供我的用户可访问的JMS队列.
I would like to use Apache Spark in order to treat data in my data base. When i detect a specific behaviou I want to trigger an event (such an alarm) to notify some users. One way would be to feed an JMS queue accessible by my users.
因此,apache spark中是否有一个框架可以在JMS队列中发送消息?
Therefore, is there a framework in apache spark to send message in a JMS queue ?
谢谢
推荐答案
没有内置框架,但是您可以使用forEachPartitions方法将数据发送到外部系统,下面是示例代码
there is no inbuilt frame work but you can use forEachPartitions method to send the data to external systems, below is the sample code
input.foreachRDD(rdd =>
rdd.foreachPartition(
partitionOfRecords =>
{
// Create Jms queue Connection Here
partitionOfRecords.foreach( messgae =>
{
jsmQueueConnection.send(message)
}
)
}))
这篇关于apache spark中是否有一个框架可以在JMS队列中发送消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文