Skip to content

Overview

Development

Overview

IDEs

API Explorer

RSS endpoint

The RSS endpoint enables developers to write integrations that invoke a configured service when changes occur in an RSS feed.

Properties

Property Default Description
URL (required) The URL hosting the RSS feed.
Service (required) The service to execute when the endpoint is triggered.
Polling Interval (required) The interval in seconds, at which TORO Integrate checks for changes in the RSS feed.
Only New Entries false When checked, only 'unread' entries in the RSS feed will be sent to the service.
Run As 'Anonymous' The user to run the service in behalf of. This is logged to Tracker.
Log to Tracker false Flag determining whether executions should be logged to the Tracker.
Document Type 'RSS' The document type to be registered to the Tracker when this endpoint is triggered.

Service

When the endpoint is triggered, the following variables are exposed to the configured service:

Name Gloop Object Description
parameters GloopObjectObject (java.util.Map) Contains all the variables below.
esbPackage io.toro.integrate.package.Package The Integrate package that contains this endpoint.
properties GloopObjectObject (java.util.Map) Contains all the properties associated with the endpoint.
context GloopObjectObject (org.quartz.JobExecutionContext) The Quartz context.
jobDataMap GloopObjectObject (org.quartz.JobDataMap) The Quartz job data map.
job GloopObjectObject (org.quartz.Job) The Quartz job.
feed io.toro.integrate.rss.Feed The Model containing the RSS feed.
entries io.toro.integrate.rss.Entry[] The list of entries in the RSS feed.
entry io.toro.integrate.rss.Entry The newest entry in the feed.
internalId java.lang.String Tracker internal ID. If the endpoint was configured to not track, this value will be null.
Name Type Description
parameters java.util.Map Contains all the variables below.
esbPackage ESBPackage The Integrate package that contains this endpoint.
properties java.util.Map Contains all the properties associated with the endpoint.
context org.quartz.JobExecutionContext The Quartz context.
jobDataMap org.quartz.JobDataMap The Quartz job data map.
job org.quartz.Job The Quartz job.
feed SyndFeed The object containing the RSS feed.
entries List<SyndEntry> The list of entries in the RSS feed.
entry SyndEntry The newest entry in the feed.
internalId java.lang.String Tracker internal ID. If the endpoint was configured to not track, this value will be null.

Example

Gloop as a Service

Consider the following input of a Gloop service:

RSS-reading service input

We can write an integration that prints the contents of the RSS feed that triggered the endpoint:

RSS-reading service

(1) This line will iterate over the entries.
(2) Every item is printed using the logger.

Groovy Script as a Service

Consider this Groovy script that simply prints the available variables in the context:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[ 
    'parameters',
    'esbPackage',
    'properties',
    'context',
    'jobDataMap',
    'job',
    'feed',
    'entries',
    'entry',
    'internalId' ].each {

    println "$it\t : " + this[it]
}

When the endpoint is triggered - in this case, the polling interval has elapsed - the console prints accordingly:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
parameters   : [ <omitted> ]
esbPackage   : ESBPackage [name=examples]
properties   : [runAs:, schedule:repeating:120, documentType:RSS, onlyNew:false, track:false,... <omitted>]
context  : JobExecutionContext: <omitted>
jobDataMap   : [ <omitted> ]
job  : io.toro.integrate.core.endpoint.impl.rss.RSSJobWrapper@7151d1f6
feed     : <omitted>
entries : [ <omitted> ]
entry : <omitted>
internalId : null

Groovy Method as a Service

We can also use a method from a Groovy class, and use the available properties as method parameters:

1
2
3
4
5
6
7
8
class RSSExamples {

    void read( def entries ) {
        entries.each {
            "Found a new RSS item with title ${it.title}".info()
        }
    }
}

This iterates the list of SyndEntry provided by the entries variable and prints the title with the logger.

Want more examples?

The distribution ships with an Integrate package called examples, which contains services demonstrating more use cases.