or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

cdi-dependency-injection.mdconfiguration.mdcore-runtime.mddata-persistence.mdindex.mdreactive-programming.mdrest-web-services.mdscheduling.mdsecurity.mdtesting.md

index.mddocs/

0

# Quarkus

1

2

Quarkus is a Cloud Native, Container First framework for writing Java applications. It's designed for optimal performance in containerized environments, providing lightning-fast startup times and low memory usage while embracing established standards and frameworks like JAX-RS, JPA, Netty, Vert.x, and MicroProfile.

3

4

## Package Information

5

6

- **Package Name**: quarkus-bom

7

- **Package Type**: maven

8

- **Language**: Java

9

- **Maven Dependency**:

10

```xml

11

<dependency>

12

<groupId>io.quarkus</groupId>

13

<artifactId>quarkus-bom</artifactId>

14

<version>3.26.2</version>

15

<type>pom</type>

16

<scope>import</scope>

17

</dependency>

18

```

19

20

## Core Imports

21

22

Main application entry points:

23

24

```java

25

import io.quarkus.runtime.Quarkus;

26

import io.quarkus.runtime.QuarkusApplication;

27

import io.quarkus.runtime.annotations.QuarkusMain;

28

```

29

30

CDI and dependency injection:

31

32

```java

33

import jakarta.enterprise.context.ApplicationScoped;

34

import jakarta.inject.Inject;

35

import io.quarkus.arc.Arc;

36

```

37

38

Configuration:

39

40

```java

41

import org.eclipse.microprofile.config.inject.ConfigProperty;

42

import io.quarkus.arc.config.ConfigProperties;

43

```

44

45

## Basic Usage

46

47

```java

48

import io.quarkus.runtime.Quarkus;

49

import io.quarkus.runtime.QuarkusApplication;

50

import io.quarkus.runtime.annotations.QuarkusMain;

51

52

@QuarkusMain

53

public class Main {

54

public static void main(String... args) {

55

Quarkus.run(HelloApp.class, args);

56

}

57

58

public static class HelloApp implements QuarkusApplication {

59

@Override

60

public int run(String... args) throws Exception {

61

System.out.println("Hello from Quarkus application!");

62

Quarkus.waitForExit();

63

return 0;

64

}

65

}

66

}

67

```

68

69

REST endpoint example:

70

71

```java

72

import jakarta.ws.rs.*;

73

import jakarta.ws.rs.core.MediaType;

74

75

@Path("/hello")

76

public class GreetingResource {

77

78

@GET

79

@Produces(MediaType.TEXT_PLAIN)

80

public String hello() {

81

return "Hello from Quarkus!";

82

}

83

}

84

```

85

86

## Architecture

87

88

Quarkus follows a build-time optimization approach:

89

90

- **Build-time Processing**: Extensions perform heavy lifting during build, generating optimized bytecode

91

- **Runtime Layer**: Minimal runtime with ArC CDI container and reactive capabilities

92

- **Extension Ecosystem**: 160+ extensions providing integrations with databases, messaging, security, etc.

93

- **Native Compilation**: GraalVM native image support for ultra-fast startup and low memory usage

94

- **Development Experience**: Live coding with hot reload during development

95

96

This design enables Quarkus applications to start in milliseconds and consume minimal memory, making them ideal for microservices, serverless, and cloud-native deployments.

97

98

## Capabilities

99

100

### Core Runtime and Application Lifecycle

101

102

Foundation classes for Quarkus applications including main entry points, lifecycle management, and core annotations for build-time processing.

103

104

```java { .api }

105

public class Quarkus {

106

public static void run(Class<? extends QuarkusApplication> application, String... args);

107

public static void waitForExit();

108

public static void asyncExit();

109

}

110

111

public interface QuarkusApplication {

112

int run(String... args) throws Exception;

113

}

114

115

@Target(ElementType.TYPE)

116

@Retention(RetentionPolicy.RUNTIME)

117

public @interface QuarkusMain {

118

String name() default "";

119

}

120

```

121

122

[Core Runtime and Application Lifecycle](./core-runtime.md)

123

124

### CDI and Dependency Injection

125

126

ArC CDI container providing dependency injection, context management, and lifecycle handling with build-time optimization and native image support.

127

128

```java { .api }

129

public class Arc {

130

public static ArcContainer container();

131

public static boolean isStarted();

132

}

133

134

public interface ArcContainer {

135

<T> InstanceHandle<T> instance(Class<T> type, Annotation... qualifiers);

136

<T> InjectableInstance<T> select(Class<T> type, Annotation... qualifiers);

137

}

138

```

139

140

[CDI and Dependency Injection](./cdi-dependency-injection.md)

141

142

### RESTful Web Services

143

144

JAX-RS implementation with RESTEasy Reactive for building high-performance REST APIs with full OpenAPI integration and native compilation support.

145

146

```java { .api }

147

@Target({ElementType.TYPE, ElementType.METHOD})

148

@Retention(RetentionPolicy.RUNTIME)

149

public @interface Path {

150

String value();

151

}

152

153

@Target(ElementType.METHOD)

154

@Retention(RetentionPolicy.RUNTIME)

155

public @interface GET {}

156

157

@Target(ElementType.METHOD)

158

@Retention(RetentionPolicy.RUNTIME)

159

public @interface POST {}

160

```

161

162

[RESTful Web Services](./rest-web-services.md)

163

164

### Configuration Management

165

166

MicroProfile Config implementation with build-time resolution, type-safe configuration mapping, and support for multiple configuration sources.

167

168

```java { .api }

169

@Target({ElementType.FIELD, ElementType.PARAMETER})

170

@Retention(RetentionPolicy.RUNTIME)

171

public @interface ConfigProperty {

172

String name() default "";

173

String defaultValue() default ConfigProperty.UNCONFIGURED_VALUE;

174

}

175

176

@Target(ElementType.TYPE)

177

@Retention(RetentionPolicy.RUNTIME)

178

public @interface ConfigMapping {

179

String prefix() default "";

180

}

181

```

182

183

[Configuration Management](./configuration.md)

184

185

### Data Persistence and ORM

186

187

Hibernate ORM integration with Panache for simplified data access, transaction management, and support for both imperative and reactive database operations.

188

189

```java { .api }

190

@Target(ElementType.TYPE)

191

@Retention(RetentionPolicy.RUNTIME)

192

public @interface Entity {}

193

194

public class PanacheEntity {

195

public void persist();

196

public void delete();

197

public static <T extends PanacheEntity> List<T> listAll();

198

public static <T extends PanacheEntity> T findById(Object id);

199

}

200

```

201

202

[Data Persistence and ORM](./data-persistence.md)

203

204

### Security and Authentication

205

206

Comprehensive security framework with support for OIDC, JWT, RBAC, and integration with various authentication providers and security standards.

207

208

```java { .api }

209

@Target({ElementType.TYPE, ElementType.METHOD})

210

@Retention(RetentionPolicy.RUNTIME)

211

public @interface RolesAllowed {

212

String[] value();

213

}

214

215

@Target({ElementType.TYPE, ElementType.METHOD})

216

@Retention(RetentionPolicy.RUNTIME)

217

public @interface PermitAll {}

218

219

public interface QuarkusSecurityIdentity extends SecurityIdentity {

220

Principal getPrincipal();

221

Set<String> getRoles();

222

}

223

```

224

225

[Security and Authentication](./security.md)

226

227

### Reactive Programming

228

229

Reactive programming model with Mutiny, reactive messaging, and event-driven architecture support for building scalable asynchronous applications.

230

231

```java { .api }

232

@Target(ElementType.METHOD)

233

@Retention(RetentionPolicy.RUNTIME)

234

public @interface Incoming {

235

String value();

236

}

237

238

@Target(ElementType.METHOD)

239

@Retention(RetentionPolicy.RUNTIME)

240

public @interface Outgoing {

241

String value();

242

}

243

244

public class Uni<T> {

245

public static <T> Uni<T> createFrom();

246

public Uni<Void> subscribe();

247

public <R> Uni<R> map(Function<? super T, ? extends R> mapper);

248

}

249

```

250

251

[Reactive Programming](./reactive-programming.md)

252

253

### Testing Framework

254

255

JUnit 5 integration with Quarkus-specific testing annotations, mocking support, and test profiles for comprehensive application testing.

256

257

```java { .api }

258

@Target(ElementType.TYPE)

259

@Retention(RetentionPolicy.RUNTIME)

260

public @interface QuarkusTest {}

261

262

@Target(ElementType.TYPE)

263

@Retention(RetentionPolicy.RUNTIME)

264

public @interface QuarkusIntegrationTest {}

265

266

@Target(ElementType.TYPE)

267

@Retention(RetentionPolicy.RUNTIME)

268

public @interface TestProfile {

269

Class<? extends QuarkusTestProfile> value();

270

}

271

```

272

273

[Testing Framework](./testing.md)

274

275

### Scheduling and Background Tasks

276

277

Cron-like scheduling capabilities with programmatic scheduler access and comprehensive lifecycle event handling for background task management.

278

279

```java { .api }

280

@Target(ElementType.METHOD)

281

@Retention(RetentionPolicy.RUNTIME)

282

public @interface Scheduled {

283

String cron() default "";

284

String every() default "";

285

long delay() default -1;

286

TimeUnit delayUnit() default TimeUnit.MILLISECONDS;

287

}

288

289

public interface Scheduler {

290

void pause();

291

void resume();

292

boolean isRunning();

293

}

294

```

295

296

[Scheduling and Background Tasks](./scheduling.md)

297

298

## Types

299

300

```java { .api }

301

// Core application lifecycle

302

public interface QuarkusApplication {

303

int run(String... args) throws Exception;

304

}

305

306

// CDI container interfaces

307

public interface ArcContainer {

308

<T> InstanceHandle<T> instance(Class<T> type, Annotation... qualifiers);

309

<T> InjectableInstance<T> select(Class<T> type, Annotation... qualifiers);

310

}

311

312

public interface InstanceHandle<T> extends AutoCloseable {

313

T get();

314

void destroy();

315

}

316

317

// Configuration interfaces

318

public interface ConfigMapping {

319

String prefix() default "";

320

}

321

322

// Security interfaces

323

public interface QuarkusSecurityIdentity extends SecurityIdentity {

324

Principal getPrincipal();

325

Set<String> getRoles();

326

<T> Attribute<T> getAttribute(String name);

327

}

328

329

// Reactive types

330

public class Uni<T> {

331

public static <T> Uni<T> createFrom();

332

public Uni<Void> subscribe();

333

public <R> Uni<R> map(Function<? super T, ? extends R> mapper);

334

public <R> Uni<R> flatMap(Function<? super T, Uni<? extends R>> mapper);

335

}

336

337

public class Multi<T> {

338

public static <T> Multi<T> createFrom();

339

public Multi<T> filter(Predicate<? super T> predicate);

340

public <R> Multi<R> map(Function<? super T, ? extends R> mapper);

341

}

342

343

// Testing interfaces

344

public interface QuarkusTestProfile {

345

Map<String, String> getConfigOverrides();

346

Set<Class<?>> getEnabledAlternatives();

347

String getConfigProfile();

348

}

349

350

// Scheduler interfaces

351

public interface ScheduledExecution {

352

String getIdentity();

353

Instant getScheduledFireTime();

354

Instant getPreviousFireTime();

355

}

356

```