Skip to content

An example Java Spring application integrating with Tarantool using the tarantool-client library, demonstrating CRUD operations, pagination, and custom annotation-based configuration.

Notifications You must be signed in to change notification settings

bkudaibergenov/tarantool-client-java-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tarantool Client Java Example

This project is an example service for working with the Tarantool database using the tarantool-client library in a Java Spring application. The service demonstrates basic CRUD operations and pagination with Tarantool. Note that the tarantool-client library is a commercial product provided with Tarantool Enterprise.

Project Structure

  • Application: Main entry point of the Spring Boot application.
  • Configuration: Tarantool client configuration setup.
  • Controller: RESTful endpoints for managing products.
  • DTO: Data Transfer Objects for API requests and responses.
  • Exception Handling: Global exception handling for the application.
  • Model: Represents the Product entity.
  • Service: Business logic for product management.
  • Test: Unit tests for the controller.

Getting Started

Prerequisites

  • Java 21
  • Gradle
  • Tarantool server

Installation

  1. Clone the repository:

    git clone https://github.com/bkudaibergenov/tarantool-client-java-example.git
    cd tarantool-client-java-example
  2. Configure the application.yml file with your Tarantool database settings:

    tarantooldb:
      user: your_user
      password: your_password
      nodes:
        - port: 3301
          tag: main
  3. Build the project:

    ./gradlew build
  4. Run the application:

    ./gradlew bootRun

Usage

The service exposes a set of RESTful endpoints to manage products.

  • Get all products: GET /api/v1/products
  • Get products with pagination: GET /api/v1/products/pagination?offset={offset}&limit={limit}
  • Get product by ID: GET /api/v1/products/{id}
  • Create or update a product: PUT /api/v1/products
  • Create a new product: POST /api/v1/products
  • Delete a product by ID: DELETE /api/v1/products/{id}
  • Find products by name and/or description: GET /api/v1/products/search?name={name}&description={description}
  • Delete all products: DELETE /api/v1/products/all

Testing

To run the unit tests, use:

./gradlew test

Contact

For any questions or inquiries, you can reach me at [email protected].

About

An example Java Spring application integrating with Tarantool using the tarantool-client library, demonstrating CRUD operations, pagination, and custom annotation-based configuration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published