The Agent SDK for Java allows you to leverage the Perspectium Replication Framework to write your own Java applications to consume and produce messages with the Perspectium Integration Mesh. This provides you a way to integrate custom applications with Perspectium-supported applications.
To set up the Agent SDK, follow these steps:
Once you have obtained your Perspectium Agent SDK Account from Perspectium Support, you will need to add the Perspectium Maven Repository URL and login credentials to your Maven settings.xml file and your SDK project pom.xml file.
Setting up settings.xml
Since the Perspectium Nexus server requires authentication, you will also need to place your credentials in the Maven settings.xml in a servers element. There are two locations where a settings.xml file may live:
Here's a sample servers element using the default username and password for the deployment user:
Setting up pom.xml
Next, create a pom.xml file for your Java project with a dependency to the Perspectium Agent SDK library. The pom.xml will look similar to this:
You can import the project into your Integrated Development Environment (IDE) such as Eclipse or you can build the project and run the application in a terminal window.
To build and run in a terminal, follow these steps:
Unzip the attachment
Navigate to the folder where you downloaded the sample Java project zip file and unzip the file.
Build the project
Open up a terminal window and go into the directory where the file was unzipped and enter the following command to build the project:
This will use Maven to compile and build the project into a Java application that can then be run.
Run the application
In the same terminal window and in the same directory as the previous step, run the following command to run the application:
You will see the Java application publish messages and consume messages, logging out as it does these actions.