-
Notifications
You must be signed in to change notification settings - Fork 25
How to start a standard java Qanary component
A standard java Qanary component can be started in two different ways. The simplest way to start a component is to use the Dockerfile. The other way is to start the component from the built jar file.
Most standard components have the same kind of properties they need to start correctly. You can find all properties in the application.properties
file, this file will usually be saved in /src/main/resources/config/
. A lot of Properties will be prefilled like server.port
and spring.application.name
.
If you want to change properties for your component, you can use environment variables for this. All properties can simply set by using the property name in caps and replace ever dot with an underscore. E.g. : server.port
will be SERVER_PORT
. To start the component, you just need to run a simple command:
- name of the component 'example component'
- using the Docker image 'example-component:latest'
- component is listening on 'http://example.component:5555'
- connecting to the Qanary pipeline on 'http://example.pipeline:8080'
docker run -p 5555:5555 \
-e SERVER_PORT=5555 \
-e SPRING_BOOT_ADMIN_URL=http://example.pipeline:8080 \
-e SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE-BASE-URL=http://example.component:5555 \
example-component:latest
If you want to change properties for your component, you can do this directly in the application.properties
file. However, it is better to create a local.application.properties
file next to the application.properties
file and overwrite all the necessary properties.
The most java Qanary component using maven, so for the build process you can simple use the maven install command in the root folder of the component:^1
mvn clean install
After downloading all necessary dependencies and building the component you will find a target folder in the component folder. In this folder you will find the jar file, which you can start with this command:
- name of the component 'example component'
java -jar example-component.jar
-
How to establish a Docker-based Qanary Question Answering system
-
How to implement a new Qanary component
... using Java?
... using Python (Qanary Helpers)?
... using Python (plain Flask service)?