Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus Embedded Docs #10746

Merged
merged 3 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions build/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@
<artifactId>infinispan-anchored-keys</artifactId>
<version>${version.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-quarkus-embedded</artifactId>
<version>${version.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[id='quarkus_embedded']
:context: quarkus
= Using the Quarkus extension
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "Getting started with {brandname} Quarkus embedded extension"?

{brandname} provides an extension that integrates with the Quarkus framework.
The extension lets you create natively compiled {brandname} applications.

include::{topics}/ref_quarkus_dependencies.adoc[leveloffset=+1]
include::{topics}/proc_quarkus_injecting_embedded.adoc[leveloffset=+1]
include::{topics}/proc_quarkus_native_compilation.adoc[leveloffset=+1]

// Restore the parent context.
ifdef::parent-context[:context: {parent-context}]
ifndef::parent-context[:!context:]
3 changes: 3 additions & 0 deletions documentation/src/main/asciidoc/titles/embedding/stories.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ include::{stories}/assembly_setting_up_clusters.adoc[leveloffset=+1]
include::{stories}/assembly_clustered_locks.adoc[leveloffset=+1]
include::{stories}/assembly_cluster_executor.adoc[leveloffset=+1]
include::{stories}/assembly_streams.adoc[leveloffset=+1]
ifdef::community[]
include::{stories}/assembly_quarkus_embedded.adoc[leveloffset=+1]
endif::community[]
include::{stories}/assembly_cdi.adoc[leveloffset=+1]
include::{stories}/assembly_jcache.adoc[leveloffset=+1]
include::{stories}/assembly_multimap_cache.adoc[leveloffset=+1]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-quarkus-embedded</artifactId>
</dependency>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[id='quarkus_inject_embedded']
= Injecting Embedded Caches
Inject a `EmbeddedCacheManager` instance into your Quarkus application to interact with {brandname} caches..

.Procedure

. Optional: Use the `quarkus.infinispan-embedded.xml-config` property to set the path to an XML file that includes the configuration of the injected instance.
+
[source,java]
----
quarkus.infinispan-embedded.xml-config=/example/path/to/config.xml
----
. Add the `@Inject` annotation to an uninitialized `EmbeddedCacheManager` class variable.
+
[source,java]
----
import javax.inject.Inject;
import org.infinispan.manager.EmbeddedCacheManager;
...
@Path("/example")
public class ExampleResource {

@Inject
EmbeddedCacheManager emc;
}
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[id='quarkus_native_compilation']
= Compiling Quarkus {brandname} application
Generate a native executable for Quarkus {brandname} application.

.Prerequisites

* Have a Quarkus based project. For a complete list of prerequisites, see link:https://quarkus.io/guides/building-native-image#prerequisites[Quarkus native prerequisites].

.Procedure
* Natively compile your Quarkus {brandname} application:
+
[source]
----
mvn clean package -Pnative
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[id='quarkus_embedded_dependencies']
= Quarkus dependencies
Include the {brandname} Quarkus extension in your `pom.xml`:

.Embedded mode
----
include::dependencies_maven/cdi_embedded_quarkus.xml[]
----