User Tools

Site Tools


documentation:software:webapi:r_service_bus_setup_guide

This is an old revision of the document!


R Service Bus Setup Guide


!! Work in Progress - not complete or functional !!

  • Install R

Required R Packages

RSB requires additional the following R Packages be loaded into your R environment

install.packages("XML")
install.packages("RJSONIO")
install.packages(c("properties", "RSBXml", "RSBJson"), repos = "http://repos.openanalytics.eu", type = "source")
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.0")
  • Deploy R Service Bus WAR

Test RSB deployment status:

  http://webserver/rsb/api/rest/system/health/check
  • Deploy RPooli WAR
    • requires R_HOME environment variable

Sample poolconfig.properties

max_wait.millis=3000
min_idle.millis=600000
max_total.count=20
eviction_timeout.millis=1800000
max_idle.count=10
min_idle.count=5
max_usage.count=100

Sample rconfig.properties

r_home.path=C\:\\Program Files\\R\\R-3.2.2
r_startup.snippet=library(RSBXml)\r\nlibrary(RSBJson)
debug_verbose.enabled=true
debug_console.enabled=false
node_cmd.args=
startstop_timeout.millis=30000

Enabling CORS access to RPooli

To enable CORS on Tomcat add the following section to the RPooli web.xml

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Sending a Job to your R Pool

Sending a job to the RSB Rest Job endpoint is a POST to the following endpoint:

  http://webserver/rsb/api/rest/jobs

The Job message format is as follows:

{
  "RFunction":"paste",
  "a": 1, 
  "b" : 2
}

wherein the RFunction attribute contains the function that will be the target of an R call to do.call and the remaining named attributes will be passed as a named list of parameters to the RFunction.

Debugging an Installation

Make sure R is up to date and all the necessary R packages have been installed. Start by checking your container log file, for example if you are running in Tomcat, check the Tomcat log for errors.

documentation/software/webapi/r_service_bus_setup_guide.1471983518.txt.gz ยท Last modified: 2016/08/23 20:18 by jhardin