Application packages can contain Java components to be run in container clusters. The most common component types are:
Components are constructed by dependency injection and are reloaded safely on deployment without restarts. See the container documentation for more details.
See the sample applications in getting started, to find examples of applications containing Java components. Also see troubleshooting.
The development cycle consists of creating the component, deploying the application package to Vespa, writing tests, and iterating. These steps refer to files in album-recommendation-java:
Build |
All the Vespa sample applications use the bundle plugin to build the components. | |
---|---|---|
Configure |
A key Vespa feature is code and configuration consistency, deployed using an application package. This ensures that code and configuration is in sync, and loaded atomically when deployed. This is done by generating config classes from config definition files. In Vespa and application code, configuration is hence accessed through generated config classes - read more in the Cloud Configuration System.
The Maven target After generating config classes, they will resolve in tools like IntelliJ IDEA. | |
Tests |
Examples unit tests are found in
MetalSearcherTest.java.
Read more in unit testing. |
|
Debug |
To connect a debugger, use Java Debug Wire Protocol (JDWP) - instructions. |
If you use IntelliJ, you can install the Vespa IntelliJ plugin to simplify working with schema files.