The Correlation RA Getting Started guide walks step by step deploying the RA and running an example SLEE service that is included in the package. This service can trigger the Correlation RA to allocate a correlation ID for specified data and retrieve the data with the allocated correlation ID.

Download and Unpack the Correlation RA

The Correlation RA package can be downloaded from Correlation Resource Adaptor. The RA package includes:

  • Resource Adaptor

  • Java doc

  • HTTP-based SLEE service example

Unpack the Correlation resource adaptor distribution package into $RHINO_HOME.

Note If unpacked elsewhere, adjust the client.home configuration property in the build.properties file.

An example on how this is done in Rhino SDK is shown below:

$ cd RhinoSDK
$ unzip correlation.zip
$ cd correlation-XX/examples
$ ant -p

Refer to Rhino SDK Getting Started Guide for information on installing a RhinoSDK or Rhino Production Getting Started Guide for information on installing a Rhino cluster.

Deploy the Correlation RA and example service

The property http.bindaddresses in build.properties specifies the IP address and port that the HTTP RA will attempt to listen on when it is activated.

The default address is 0.0.0.0 (ie. all interfaces). The default port for RhinoSDK is 8000. For Rhino Production the default for node 101 is 8000 and for node 102 is 8001.

Edit these properties if necessary for your environment. See detailed configuration in Configuring the HTTP Resource Adaptor

To deploy the example, using Ant, execute the deploy target.

Note Ensure that the Rhino SDK or cluster is running.
$ ant deploy

This will deploy the Correlation and HTTP resource adaptors, and the example service.

Use an HTTP client to test

The Correlation RA can be tested by using the example HTTP SLEE service. The service is triggered by sending GET requests i.e. via curl with specified action and data in the request URL.

Here are some examples:

Command Output Description

curl '127.0.0.1:8000/?action=gets&data=mydata' && echo && curl '127.0.0.1:8000/?action=returns&data=12101'

12101

CorrelationResultEvent [correlationData=[109, 121, 100, 97, 116, 97], correlationId=12101]

Allocate a correlation ID for test data mydata. This will return the correlation ID that is allocated in Rhino node 101 or Rhino SDK where the HTTP RA is listening on.

The second action returns the test data associated with the correlation ID 12101 that is allocated on the local node 101 or Rhino SDK. This action uses getCorrelationData(String correlationId) API.

curl '127.0.0.1:8001/?action=gets&data=mydata' && echo && curl '127.0.0.1:8000/?action=returne&data=12102'

12102

CorrelationResultEvent [correlationData=[109, 121, 100, 97, 116, 97], correlationId=12102]

Note Only applicable to Rhino Production

Allocate a correlation ID for test data mydata on node 102 and then return the test data associated with the correlation ID 12102 via node 101.

The second action creates an activity and then uses it for the async request.

curl '127.0.0.1:8001/?action=gets&data=mydata' && echo && curl '127.0.0.1:8000/?action=returnf&data=12102'

12102

CorrelationResult [async=true, data=[109, 121, 100, 97, 116, 97], id=12102]

Note Only applicable to Rhino Production

Allocate a correlation ID for test data mydata on node 102 and then return the test data associated with the correlation ID 12102 via node 101. Since the data is only available on a remote node, this will block and return when the data is available.

The second action uses getCorrelationDataSynchronously(String correlationId) API.