You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2021/10/22 13:30:46 UTC

[camel-quarkus] 01/06: Improve AWS2 DDB docs #3195

This is an automated email from the ASF dual-hosted git repository.

ppalaga pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 1ef0feb77e9cc0722966915db723e205aa46cd5c
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Mon Oct 18 12:37:25 2021 +0200

    Improve AWS2 DDB docs #3195
---
 .../ROOT/pages/reference/extensions/aws2-ddb.adoc       | 17 ++++++++++++-----
 .../aws2-ddb/runtime/src/main/doc/configuration.adoc    | 17 ++++++++++++-----
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/docs/modules/ROOT/pages/reference/extensions/aws2-ddb.adoc b/docs/modules/ROOT/pages/reference/extensions/aws2-ddb.adoc
index 2353363..10eb0d3 100644
--- a/docs/modules/ROOT/pages/reference/extensions/aws2-ddb.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/aws2-ddb.adoc
@@ -51,8 +51,8 @@ https://quarkus.io/guides/native-and-ssl[Quarkus SSL guide].
 === Optional integration with Quarkus Amazon DynamoDB
 
 If desired, it is possible to use the Quarkus Amazon DynamoDB Client extension in conjunction with Camel Quarkus AWS2 DDB.
-Note that this optional and not at all mandatory.
-Follow the https://quarkus.io/guides/amazon-dynamodb#configuring-dynamodb-clients[documentation] with some caveats.
+Note that this is fully optional and not at all mandatory.
+Follow the https://quarkus.io/guides/amazon-dynamodb#configuring-dynamodb-clients[Quarkus documentation] with some caveats.
 
 1. The Apache client type has to be selected by configuring the following property.
 +
@@ -61,13 +61,20 @@ Follow the https://quarkus.io/guides/amazon-dynamodb#configuring-dynamodb-client
 quarkus.dynamodb.sync-client.type=apache
 ----
 
-2. The `DynamoDbClient` has to be injected somewhere in the application. This triggers its creation so that the Camel component can discover it.
+2. The `DynamoDbClient` has to be "unremovable" in the sense of https://quarkus.io/guides/cdi-reference#remove_unused_beans[Quarkus CDI reference] so that Camel Quarkus is able to look it up at runtime.
+You can reach that e.g. by adding a dummy bean injecting `DynamoDbClient`:
 +
 [source,java]
 ----
+import javax.enterprise.context.ApplicationScoped;
+import io.quarkus.arc.Unremovable;
 import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
 
-@Inject
-DynamoDbClient dynamoDB;
+@ApplicationScoped
+@Unremovable
+class UnremovableDynamoDbClient {
+    @Inject
+    DynamoDbClient dynamoDB;
+}
 ----
 
diff --git a/extensions/aws2-ddb/runtime/src/main/doc/configuration.adoc b/extensions/aws2-ddb/runtime/src/main/doc/configuration.adoc
index 284362d..b74af43 100644
--- a/extensions/aws2-ddb/runtime/src/main/doc/configuration.adoc
+++ b/extensions/aws2-ddb/runtime/src/main/doc/configuration.adoc
@@ -1,8 +1,8 @@
 === Optional integration with Quarkus Amazon DynamoDB
 
 If desired, it is possible to use the Quarkus Amazon DynamoDB Client extension in conjunction with Camel Quarkus AWS2 DDB.
-Note that this optional and not at all mandatory.
-Follow the https://quarkus.io/guides/amazon-dynamodb#configuring-dynamodb-clients[documentation] with some caveats.
+Note that this is fully optional and not at all mandatory.
+Follow the https://quarkus.io/guides/amazon-dynamodb#configuring-dynamodb-clients[Quarkus documentation] with some caveats.
 
 1. The Apache client type has to be selected by configuring the following property.
 +
@@ -11,12 +11,19 @@ Follow the https://quarkus.io/guides/amazon-dynamodb#configuring-dynamodb-client
 quarkus.dynamodb.sync-client.type=apache
 ----
 
-2. The `DynamoDbClient` has to be injected somewhere in the application. This triggers its creation so that the Camel component can discover it.
+2. The `DynamoDbClient` has to be "unremovable" in the sense of https://quarkus.io/guides/cdi-reference#remove_unused_beans[Quarkus CDI reference] so that Camel Quarkus is able to look it up at runtime.
+You can reach that e.g. by adding a dummy bean injecting `DynamoDbClient`:
 +
 [source,java]
 ----
+import javax.enterprise.context.ApplicationScoped;
+import io.quarkus.arc.Unremovable;
 import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
 
-@Inject
-DynamoDbClient dynamoDB;
+@ApplicationScoped
+@Unremovable
+class UnremovableDynamoDbClient {
+    @Inject
+    DynamoDbClient dynamoDB;
+}
 ----