ActiveMQ package for R

旧时模样 提交于 2020-01-17 04:57:05

问题


I'm trying to have a model I've built in R sent messages to an activeMQ queue. A quick googling of R points me to Rjms; however, when I check for the package on CRAN, I get an error saying "Package ‘Rjms’ was removed from the CRAN repository." Further googling just pushes me back to Rjms.

Given this, is there an ActiveMQ package available in the R language?


回答1:


You can install the current version from Github. First, you need to install the dependency Rjmsjars.

library(devtools)
install_github("cran/Rjmsjars")
install_github("smschauhan/Rjms/src/main/resources/Rjms")



回答2:


I ended up installing the packages via wget tarballs rather than via github, as I was encountering a Java exception when loading the packages installed via github.

from the command line:

wget http://cran.r-project.org/src/contrib/Archive/Rjmsjars/Rjmsjars_0.0.1.tar.gz
wget http://cran.r-project.org/src/contrib/Archive/Rjms/Rjms_0.0.5.tar.gz

then within the R interactive terminal:

install.packages('~/Rjmsjars_0.0.1.tar.gz', repos = NULL, type ="source")
install.packages('~/Rjms_0.0.5.tar.gz', repos = NULL, type ="source")

When loading the package, I am indeed able to initialize a logger and send a message without a Java exception:

library(Rjms)
logger <- initialize.logger('tcp://xxx.xx:61616', 'Q', "test")
send.status<-to.logger(logger, "{xxx: xxx, xxx: .xx}")
send.status
[1] TRUE


来源:https://stackoverflow.com/questions/27282915/activemq-package-for-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!