/quarkus-minio

Minio (https://min.io) Client Quarkus Extension

Primary LanguageJavaApache License 2.0Apache-2.0

Quarkus Minio Extension

All Contributors Build Maven Central License

Integrate minio sdk for jdk and native build modes.

Configuration

After configuring quarkus BOM:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>${insert.newest.quarkus.version.here}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

You can just configure the quarkus-minio extension by adding the following dependency:

<dependency>
    <groupId>io.quarkiverse.minio</groupId>
    <artifactId>quarkus-minio</artifactId>
    <version>${latest.release.version}</version>
</dependency>

Usage

An io.minio.MinioClient is made available to your application as a CDI bean if configuration is found.

package com.acme.minio;

import io.minio.MinioClient;

import javax.enterprise.context.ApplicationScoped;

import javax.inject.Inject;

@ApplicationScoped
public class SampleService {

    @Inject
    MinioClient minioClient;

    @ConfigProperty(name = "minio.bucket-name")
    String bucketName;

    public String getObject(String name) {
        try (InputStream is = minio.getObject(
                GetObjectArgs.builder()
                        .bucket(bucketName)
                        .object(objectName)
                        .build());
        ) {
           // Do whatever you want...
        } catch (MinioException e) {
            throw new IllegalStateException(e);
        }
    }

}

Configuration Reference

Configuration is done through standard application.properties mechanism. Configuration is optional, but if present url has to be a valid http url.

quarkus.minio.url=https://minio.acme
quarkus.minio.access-key=DUMMY-ACCESS-KEY
quarkus.minio.secret-key=DUMMY-SECRET-KEY

Contributors ✨

Thanks goes to these wonderful people (emoji key):


jtama-op

💻 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!

WARNING

This project is still in its early stage.

Contributions are always welcome, but this repository is not really ready for external contributions yet, better create an issue to discuss them prior to any contributions.