-
Notifications
You must be signed in to change notification settings - Fork 22
Using influxDB
Xatkit can make use of an influx 2.x database instead of the internal mapDB one. This page details how to use it.
- A working installation of Xatkit (Check Build Xatkit)
- A working installation of InfluxDB 2.0 or greater (Installing InfluxDB OSS)
Run influx setup
to create a primary organization and bucket.
If you already have an influxdb instance, consider creating a different bucket/organization for your bots with
influx org create
and
influx bucket create
run influx with
influxd --http-bind-address=:XXXX
More info: https://v2.docs.influxdata.com/v2.0/reference/cli/influx/bucket/ and https://v2.docs.influxdata.com/v2.0/reference/cli/influx/org/, also, worth reading: https://v2.docs.influxdata.com/v2.0/reference/cli/influx/
The bot's properties file will need to specify the following data to make the connection work:
- Specify to the bot that you want to use influxDB:
xatkit.database.model = influxDB
- Specify the organization and bucket that the bot will have access to, for example:
xatkit.influx.bucket = xatbot xatkit.influx.organization = X
- You will have to tell the bot which is the "token" to get access the given bucket:
xatkit.influx.token = yourBucketTokenGoesHere
- And last, where to find the influxdb instance, to start the connection:
xatkit.influx.url = http://localhost:7777
A complete (working) properties file example would look like this:
# Execution file containing the logic of the bot
xatkit.execution.model = src/GreetingsBot.execution
# Resolve alias imports in Execution model
xatkit.libraries.custom.GreetingsBotLib = src/GreetingsBot.intent
# Set a concrete platform to use in place of the ChatPlatform
xatkit.platforms.abstract.ChatPlatform = com.xatkit.plugins.react.platform.ReactPlatform
# Set the server port to use (defaults to 5000)
xatkit.server.port = 5060
xatkit.react.port = 5061
# Xatkit database options:
xatkit.database.model = influxDB
xatkit.influx.token = yourBucketTokenGoesHerebb==
xatkit.influx.bucket = xatbot
xatkit.influx.organization = X
xatkit.influx.url = http://localhost:7777
- Install influx (Installing InfluxDB OSS)
- Make sure to add the database options in the properties file:
# Xatkit database options:
xatkit.database.model = influxDB
xatkit.influx.token = yourBucketTokenGoesHerebb==
xatkit.influx.bucket = yourBucket
xatkit.influx.organization = yourOrg
xatkit.influx.url = http://localhost:port # Where the influxDB instance is running
Note: By using influxDB, data WON'T be stored in the internal mapDB instance, which means the bot becomes dependant on the influxDB availability to write/store data
- Getting Started
- Configuring your bot
- Integrating an Intent Recognition Provider
- Adding a bot to your website
- Deploying on Slack
- Basic concepts
- Intents and Entities
- States, Transitions, and Context
- Default and Local Fallbacks
- Core Library