Posts

Showing posts with the label Quarkus

Quarkus Export Data to CSV Example - Apache Commons

Image
Hello everyone, today we will learn how to export and download the data as a CSV file in a Quarkus we application. CSV stands for Comma-Separated-Values and it's a common format for doing a bulk data transfer between systems. For creating and parsing CSV files, we will use Apache Commons' 3rd-party library. Technologies used: Quarkus 2.2.3.final Open CSV 1.8 H2DB  Hibernate ORM panache Project directory: Maven[pom.xml]: A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details utilized by Maven to build the project. It contains default values for most projects. Some of the configurations that can be designated in the POM is the project dependencies, the plugins or goals that can be executed, the build profiles, and so on. Other information such as the project version, description, developers, mailing lists, and such can withal be designated. <?xml version = "1.0"

Generate QR Code in Quarkus Application

Image
Hello everyone, today we will learn how to generate the QR Code in the Quarkus application using zxing . Technology Used: JDK 11 Quarkus 2.2.3.Final zxing library 3.3.0 Maven 3.8.1 Project Directory: Dependency management: <? xml version ="1.0" ?> < project xsi :schemaLocation ="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns ="http://maven.apache.org/POM/4.0.0" xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance" > < modelVersion >4.0.0</ modelVersion > < groupId >org.knf.dev.demo</ groupId > < artifactId >quarku-qr-code</ artifactId > < version >1.0.0-SNAPSHOT</ version > < properties > < compiler-plugin.version >3.8.1</ compiler-plugin.version > < maven.compiler.parameters >true</ maven.compiler.parameters > < maven.compiler.source >11</ maven.compiler.source > &l

CORS with Quarkus - Example

Image
Hello everyone, today we will show you how to enable CORS support in the Quarkus application at the global level. CORS Error in Web Apps: Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources. Let's learn how to enable cors in quarkus application, Quarkus comes with a CORS filter that implements the javax.servlet.Filter interface and intercepts all incoming HTTP requests. It can be enabled in the Quarkus configuration file,  application.properties: quarkus.http.cors= true quarkus.http.cors.origins= http://localhost quarkus.http.cors.methods= GET,PUT,POST quarkus.http.cors.headers= X-Custom quarkus.http.cors.exposed-headers= Content-Disposition quarkus.http.cors.access-control-max-age= 24H quarkus.http.cors.access-control-allow-credentials= true UserResource: package com.knf.dev.demo; import javax.ws.rs. GET ; import javax