Skip to the content.

Getting Started with Symphony BDK for Java

This guide provides detailed information for beginners who want to bootstrap their first Symphony BDK project in Java. Two different approaches will be detailed here:

Starting with Symphony Generator

This section requires npm (Node Package Manager) to be installed on your local machine as a prerequisite

For all Symphony BDK applications, you should start with the Symphony Generator. The Symphony Generator offers a fast way to bootstrap your Symphony BDK project in several languages, including Java:

npm i -g generator-symphony
yo symphony 2.0

Creating your project from scratch

This section will help you to understand how to create your bot application from scratch.

Maven-based project

If you want to use Maven as build system, you have to configure your root pom.xml as such:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""

    <description>Demo project for Symphony BDK</description>


        <!-- Core dependencies -->
            <artifactId>symphony-bdk-http-jersey2</artifactId> <!-- or symphony-bdk-http-webclient -->
            <artifactId>symphony-bdk-template-freemarker</artifactId>  <!-- or symphony-bdk-http-handlebars -->
        <!-- Logger Configuration -->

Gradle-based project

If you want to use Gradle as build system, you have to configure your root build.gradle as such:

plugins {
    id 'java-library'

group = 'com.example'
version = '0.0.1-SNAPSHOT'

repositories {

dependencies {

    // import a BOM
    implementation platform('org.finos.symphony.bdk:symphony-bdk-bom:2.1.0')

    // define dependencies without versions
    implementation 'org.finos.symphony.bdk:symphony-bdk-core'
    runtimeOnly 'org.finos.symphony.bdk:symphony-bdk-http-jersey2'           //  or symphony-bdk-http-webclient
    runtimeOnly 'org.finos.symphony.bdk:symphony-bdk-template-freemarker'    // or symphony-bdk-http-handlebars

    // logger configuration
    implementation 'org.slf4j:slf4j-api'
    runtimeOnly 'ch.qos.logback:logback-classic'

Create configuration file

Before implementing any code, you need to create your src/main/resources/config.yaml configuration file according to your Symphony environment:

host:                                     # your own pod host name

    username: bot-username                                  # your bot (or service account) username
      path: /path/to/bot/rsa-private-key.pem        # your bot RSA private key

Click here for more detailed documentation about BDK configuration

Create a Simple Bot Application

Now you can create a Simple Bot Application by creating main class src/main/java/com/example/symphony/

public class BotApplication {
    public static void main(String[] args) {
        final SymphonyBdk bdk = new SymphonyBdk(BdkConfigLoader.loadFromClasspath("/config.yaml"));        // (1)
        bdk.datafeed().subscribe(new RealTimeEventListener() {                                              // (2)

            public void onMessageSent(V4Initiator initiator, V4MessageSent event) {
              bdk.messages().send(event.getMessage().getStream(), "<messageML>Hello, World!</messageML>");  // (3)
        bdk.datafeed().start();                                                                             // (4)
  1. The SymphonyBdk class acts as an entry point into the library and provides a fluent API to access to the main BDK features such as Datafeed, services or Activities
  2. Subscribe to the onMessageSent Real Time Event
  3. When any message is sent into a stream where your bot is a member, it will reply by message Hello, World!
  4. Start the Datafeed read loop

Home :house: