Install Java Development Kit
Download and install a JDK of your choice from the following vendors. Java versions 8 through 12 are supported.
Oracle: https://www.oracle.com/technetwork/java/javase/downloads/index.html
Amazon: https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html
RedHat: https://developers.redhat.com/products/openjdk/download
GraalVM: https://www.graalvm.org/downloads/
Install Maven
Download and install Maven from https://maven.apache.org/download.cgi
Get Sample Projects
Path 1: Using the Symphony Bot Generator
The easiest way to bootstrap new projects is by using the Symphony Bot Generator. This requires NodeJS and 2 npm packages. If your organisation does not allow the installation of NodeJS, refer to Path 2.
Install NodeJS
- Download and install from https://nodejs.org/en/download/
- Verify the installation by running the commands:
node -v
npm -v
Install Yeoman and Symphony Generator
- Run the command:
npm i -g yo generator-symphony
- Verify the installation by running the command:
yo
- You should see Symphony in the generators list
- Press CTRL+C / CMD+C to exit
Run Bot Generator
- Run the command:
yo symphony
- Answer the questions as follows:
Bot Generator
What do you want to create? bot
What is the name of your project? my-bot-project (rename as desired)
What is your POD subdomain? my-company (provide your actual pod sub-domain)
What is your preferred programming language? Java
What is the BOT username? my-bot-username (rename as desired)
What is the BOT email address? [email protected] (rename as desired)
What is your preferred encryption technology? RSA - Generate New Keys
Which template do you want to start with? Request/Reply
Path 2: Clone Example Project from GitHub
This method only has the basic request-reply sample.
- Obtain code
- Download and install Git from https://git-scm.com/downloads
- git clone https://github.com/SymphonyPlatformSolutions/symphony-request-reply-bot-java.git
- Alternatively, download and extract the code archive from https://github.com/SymphonyPlatformSolutions/symphony-request-reply-bot-java/archive/master.zip
- Generate RSA Key Pair
mkdir rsa
cd rsa
openssl genrsa -out rsa-mybot-private.pem 4096
openssl rsa -in rsa-mybot-private.pem -pubout -out rsa-mybot-public.pem
Create Service Account
- Go to your pod's Admin and Compliance Portal (https://[my-company].symphony.com/?admin)
- Create an Account > Service Account
- Fill in desired bot username and other details
- Paste in RSA public key from previous section
- Create
Fill Configuration File
- If you've created the project using the bot generator, the config.json file should be more or less operational
- If not, please review all items in the file and revise the values as appropriate
- You will need to make these changes if your environment has the following:
- an on-premise key manager (change keyAuthHost and keyAuthPort)
- an on-premise API Agent (change agentHost and agentPort)
- requirement for a proxy server to access the Internet (see next section)
Proxy Configuration
If you require proxy, add either proxyURL
or podProxyURL
to your config.json.
Proxy Configuration | Cloud API Agent | On-Premise API Agent |
---|---|---|
proxyURL proxyUsername proxyPassword | ✅ | |
podProxyURL podProxyUsername podProxyPassword | ✅ |
Additionally, if you are using a cloud key manager, add keyManagerProxyURL
.
Proxy Configuration | Cloud Key Manager |
---|---|
keyManagerProxyURL keyManagerProxyUsername keyManagerProxyPassword | ✅ |
Truststore Configuration
You will need to ship a custom truststore together with your bot if:
- You are using on-premise Key Managers / API Agents that serve non-publicly trusted SSL certificates (e.g. internal root CA-signed certificates)
- Your default JDK cacerts truststore does not already trust the GoDaddy/DigiCert root CA and intermediate certificates served on Symphony pods
The bot generator and sample project above both ship with a sample truststore that already contains the GoDaddy/DigiCert root CA and intermediary certificates served on Symphony pods. To add your own SSL certificates to the trust store:
- Download all root and intermediate certificates in PEM format
- For each certificate, run the command:
keytool -import -trustcacerts -keystore all_symphony_certs_truststore -storepass changeit -alias <your-cert-alias> -import -file <your-cert.pem>
Debug Project
Using IDE
Debug using standard Eclipse/IntelliJ Launch Configuration
Using Command Line
mvn install dependency:copy-dependencies
java -cp target/dependency/*:target/classes RequestReplyBot
Updated about a year ago