From 23f68480b6a8ca473bf68bfb5e854e5b5419140c Mon Sep 17 00:00:00 2001 From: revijay Date: Thu, 21 Nov 2024 14:28:50 +0530 Subject: [PATCH 01/28] Created cloudant-with-open-liberty.adoc --- ...2024-11-25-cloudant-with-open-liberty.adoc | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 posts/2024-11-25-cloudant-with-open-liberty.adoc diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc new file mode 100644 index 000000000..a54715df5 --- /dev/null +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -0,0 +1,170 @@ +--- +layout: post +title: "Access Cloudant client with Open Liberty using CDI" +categories: blog +author_picture: https://avatars3.githubusercontent.com/revijay +author_github: https://github.com/revijay +seo-title: Access Cloudant client with Open Liberty using CDI - OpenLiberty.io +seo-description: Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. Now, with improvements in CDI and the introduction of MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. Earlier cloudant-1.0 feature was implemented using Java Cloudant Client library which is not under active development now, so in this demonstration we are using Cloudant Java SDK library. +blog_description: "Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. Now, with improvements in CDI and the introduction of MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. Earlier cloudant-1.0 feature was implemented using Java Cloudant Client library which is not under active development now, so in this demonstration we are using Cloudant Java SDK library." +open-graph-image: https://openliberty.io/img/twitter_card.jpg +open-graph-image-alt: Open Liberty Logo +--- += Access Cloudant client with Open Liberty using CDI +Reshmi Vijayan +:imagesdir: / +:url-prefix: +:url-about: / + +Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. Now, with improvements in CDI and the introduction of MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). Earlier cloudant-1.0 feature was implemented using Java Cloudant Client library which is not under active development now, so in this demonstration we are using Cloudant Java SDK library. + +== A CDI producer for Cloudant +With a CDI producer, you can easily provide a Cloudant client to your application by which you can inject the client into various parts of the application in a type-safe and flexible way, while leveraging the benefits of dependency injection (such as lifecycle management and configuration).This example demonstrates how to create a CDI producer to inject a Cloudant client: +[source, java] +---- +@ApplicationScoped +public class CloudantProducer { + + @Produces + public Cloudant createCloudant() { + return new Cloudant(“cloudant”, new BasicAuthenticator.Builder().build()); + } +} +---- + +Here is an example of using the CDI producer to inject a Cloudant client in a JAX-RS application. +[source, java] +---- +@Inject +Cloudant client; +@POST +@Path("/add") +@Consumes(MediaType.APPLICATION_JSON) +public void add(CrewMember crewMember) { + Document newCrewMember = new Document(); + newCrewMember.put("Name",crewMember.getName()); + newCrewMember.put("Rank",crewMember.getRank()); + newCrewMember.put("CrewID",crewMember.getCrewID()); + + PostDocumentOptions createDocumentOptions = + new PostDocumentOptions.Builder() + .db(dbname) + .document(newCrewMember) + .build(); + DocumentResult createDocumentResponse = client + .postDocument(createDocumentOptions) + .execute() + .getResult(); +} +---- +In the above code: + +* `@Inject` is used to inject the Cloudant client instance provided by the CDI producer. +* The `postDocument` method demonstrates how to create and post a document in the cloudant database using the injected CloudantClient. + +== Enhancing the CDI producer +One of the advantages of using a CDI producer is that it can be tailored to your needs. For improved security,the `createCloudant` method can be enhanced to include authentication with a user name and password: + +[source,java] +---- +@Produces +public Cloudant createCloudant() { + String password = PasswordUtil.passwordDecode(encodedPassword); + BasicAuthenticator authenticator = new BasicAuthenticator.Builder() + .username(username) + .password(password) + .build(); + + return new Cloudant("cloudant", authenticator); +} +---- +This requires `passwordUtilities-1.0`, available as a Maven dependency: +[source,xml] +---- + + io.openliberty.features + passwordUtilities-1.0 + 18.0.0.4 + +---- + +You also need to enable the feature in `server.xml`: +[source, xml] +---- +passwordUtilities-1.0 +---- + +By default, Cloudant communication occurs over HTTPS (SSL). However, if you're working with a custom Cloudant instance or self-signed certificates, you may need to configure your Open Liberty application to trust the custom certificate. + +You can configure SSL by modifying the server.xml to use your custom SSL certificates: +[source, xml] +---- + + + + + + +---- + +== Configure with MicroProfile Config +Now that you have a more advanced CDI producer, it would be nice to add configurability to some of the variables, like the user and password. Using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] makes configuring the Cloudant driver simple. You can add the following to your CDI producer to add configuration: +[source, java] +---- +@Inject + @ConfigProperty(name = "cloudant.host", defaultValue = "localhost") + String host; + + @Inject + @ConfigProperty(name = "cloudant.port", defaultValue = "5984") + String port; + + @Inject + @ConfigProperty(name = "cloudant.username") + String username; + + @Inject + @ConfigProperty(name = "cloudant.password") + String password; + + @Inject + @ConfigProperty(name = "cloudant.dbname") + String dbname; +---- +Now, by placing the following snippet in your ``microprofile-config.properties`` or `server.env` file, the values for user and password will be pulled into the CloudantProducer class: +[source, text] +---- +cloudant.user=admin +cloudant.password={aes}AEEjCqvh7XAwDxrdYC6BUbqYlwqI8NAxRkWWWq7muxZu +---- +== No need for a Cloudant feature +Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant Java Driver API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using newer versions of Cloudant with a CDI producer. + +The Cloudant client should be bundled in your application. To do this with Maven you can use a dependency: + +[source, xml] +---- + + com.ibm.cloud + cloudant + x.x.x + +---- +If you have multiple applications accessing Cloudant, instead of bundling the Cloudant client library, you can configure a shared library in your `server.xml` like this: +[source, xml] +---- + + + + + + + + + + + +---- + +This illustrates how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config that help you to integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. +The full sample is available on GitHub here:link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant] \ No newline at end of file From 56c8ec854109353994757c868f6958e5c8a4febe Mon Sep 17 00:00:00 2001 From: revijay Date: Sun, 24 Nov 2024 14:51:00 +0530 Subject: [PATCH 02/28] Updated blog file cloudant-with-open-liberty.adoc --- ...2024-11-25-cloudant-with-open-liberty.adoc | 171 ++++++++++-------- 1 file changed, 93 insertions(+), 78 deletions(-) mode change 100644 => 100755 posts/2024-11-25-cloudant-with-open-liberty.adoc diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc old mode 100644 new mode 100755 index a54715df5..b4c1b49f8 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -1,12 +1,12 @@ --- layout: post -title: "Access Cloudant client with Open Liberty using CDI" +title: "Access Cloudant with Open Liberty using CDI" categories: blog author_picture: https://avatars3.githubusercontent.com/revijay author_github: https://github.com/revijay -seo-title: Access Cloudant client with Open Liberty using CDI - OpenLiberty.io -seo-description: Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. Now, with improvements in CDI and the introduction of MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. Earlier cloudant-1.0 feature was implemented using Java Cloudant Client library which is not under active development now, so in this demonstration we are using Cloudant Java SDK library. -blog_description: "Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. Now, with improvements in CDI and the introduction of MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. Earlier cloudant-1.0 feature was implemented using Java Cloudant Client library which is not under active development now, so in this demonstration we are using Cloudant Java SDK library." +seo-title: Access Cloudant with Open Liberty using CDI - OpenLiberty.io +seo-description: Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. +blog_description: "Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java." open-graph-image: https://openliberty.io/img/twitter_card.jpg open-graph-image-alt: Open Liberty Logo --- @@ -16,27 +16,80 @@ Reshmi Vijayan :url-prefix: :url-about: / -Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. Now, with improvements in CDI and the introduction of MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). Earlier cloudant-1.0 feature was implemented using Java Cloudant Client library which is not under active development now, so in this demonstration we are using Cloudant Java SDK library. +Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. == A CDI producer for Cloudant -With a CDI producer, you can easily provide a Cloudant client to your application by which you can inject the client into various parts of the application in a type-safe and flexible way, while leveraging the benefits of dependency injection (such as lifecycle management and configuration).This example demonstrates how to create a CDI producer to inject a Cloudant client: +With a CDI producer, you can easily provide a Cloudant client to your application by which you can inject the client into various parts of the application in a type-safe and flexible way, while leveraging the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to make the configuration of Cloudant driver simple. +This example demonstrates how to create a CDI producer to inject a Cloudant client: [source, java] ---- @ApplicationScoped public class CloudantProducer { + @Inject + @ConfigProperty(name = "cloudant.host", defaultValue = "localhost") + String host; + + @Inject + @ConfigProperty(name = "cloudant.port", defaultValue = "5984") + String port; + + @Inject + @ConfigProperty(name = "cloudant.username") + String username; + + @Inject + @ConfigProperty(name = "cloudant.password") + String encodedPassword; + + + @Inject + @ConfigProperty(name = "cloudant.dbname") + String dbname; + @Produces public Cloudant createCloudant() { - return new Cloudant(“cloudant”, new BasicAuthenticator.Builder().build()); + String password = PasswordUtil.passwordDecode(encodedPassword); + BasicAuthenticator authenticator = new BasicAuthenticator.Builder() + .username(username) + .password(password) + .build(); + + Cloudant service = new Cloudant("cloudant", authenticator); + service.setServiceUrl("http://" + host + ":" + port); + + return service; } } ---- +One of the advantages of using a CDI producer is that it can be tailored to your needs. For improved security,the createCloudant method is enhanced to include authentication with a user name and password. This requires the following Maven dependency: +[source,xml] +---- + + com.ibm.websphere.appserver.api + com.ibm.websphere.appserver.api.passwordUtil + 1.0.95 + +---- +You also need to enable the feature in `server.xml`: +[source, xml] +---- +passwordUtilities-1.0 +---- +Now, by placing the following snippet in your ``microprofile-config.properties`` or `server.env` file, the values for user and password will be pulled into the CloudantProducer class: +[source, text] +---- +cloudant.user=admin +cloudant.password={aes}AEEjCqvh7XAwDxrdYC6BUbqYlwqI8NAxRkWWWq7muxZu +---- +== Injecting the Cloudant client Here is an example of using the CDI producer to inject a Cloudant client in a JAX-RS application. [source, java] ---- @Inject Cloudant client; + @POST @Path("/add") @Consumes(MediaType.APPLICATION_JSON) @@ -57,90 +110,52 @@ public void add(CrewMember crewMember) { .getResult(); } ---- + In the above code: * `@Inject` is used to inject the Cloudant client instance provided by the CDI producer. -* The `postDocument` method demonstrates how to create and post a document in the cloudant database using the injected CloudantClient. +* The `PostDocumentOptions` is a builder class that allows you to specify various options when posting the document. You must provide the db name and the document content. +* The `postDocument` is the main method that posts the document to the specified database. It returns a DocumentResult object which contains metadata about the inserted document (like its _id and _rev). -== Enhancing the CDI producer -One of the advantages of using a CDI producer is that it can be tailored to your needs. For improved security,the `createCloudant` method can be enhanced to include authentication with a user name and password: - -[source,java] +Similarly, we can delete a document from Cloudant using its `id`. +[source, java] ---- -@Produces -public Cloudant createCloudant() { - String password = PasswordUtil.passwordDecode(encodedPassword); - BasicAuthenticator authenticator = new BasicAuthenticator.Builder() - .username(username) - .password(password) +@DELETE +@Path("/{id}") +public String remove(@PathParam("id") String id) { + GetDocumentOptions documentInfoOptions = + new GetDocumentOptions.Builder() + .db(dbname) + .docId(id) .build(); - return new Cloudant("cloudant", authenticator); -} ----- -This requires `passwordUtilities-1.0`, available as a Maven dependency: -[source,xml] ----- - - io.openliberty.features - passwordUtilities-1.0 - 18.0.0.4 - ----- - -You also need to enable the feature in `server.xml`: -[source, xml] ----- -passwordUtilities-1.0 ----- - -By default, Cloudant communication occurs over HTTPS (SSL). However, if you're working with a custom Cloudant instance or self-signed certificates, you may need to configure your Open Liberty application to trust the custom certificate. - -You can configure SSL by modifying the server.xml to use your custom SSL certificates: -[source, xml] ----- - - - - - - ----- + Document document = client + .getDocument(documentInfoOptions) + .execute() + .getResult(); -== Configure with MicroProfile Config -Now that you have a more advanced CDI producer, it would be nice to add configurability to some of the variables, like the user and password. Using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] makes configuring the Cloudant driver simple. You can add the following to your CDI producer to add configuration: -[source, java] + DeleteDocumentOptions deleteDocumentOptions = + new DeleteDocumentOptions.Builder() + .db(dbname) + .docId(id) + .rev(document.getRev()) + .build(); + + DocumentResult deleteDocumentResponse = client + .deleteDocument(deleteDocumentOptions) + .execute() + .getResult(); +} ---- -@Inject - @ConfigProperty(name = "cloudant.host", defaultValue = "localhost") - String host; - - @Inject - @ConfigProperty(name = "cloudant.port", defaultValue = "5984") - String port; +In the above example: - @Inject - @ConfigProperty(name = "cloudant.username") - String username; +* The `GetDocumentOptions` class is used to configure parameters for retrieving a document from a Cloudant database. It allows you to specify the database name, document ID, and optional parameters like the document revision, whether to include attachments, conflicts, or deleted information in the response. The class uses the builder pattern to set these options before making the request to Cloudant. +* The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (_rev) of the document to ensure that the correct version is deleted (to prevent race conditions). This class uses the builder pattern to set options before sending the delete request to Cloudant. - @Inject - @ConfigProperty(name = "cloudant.password") - String password; - - @Inject - @ConfigProperty(name = "cloudant.dbname") - String dbname; ----- -Now, by placing the following snippet in your ``microprofile-config.properties`` or `server.env` file, the values for user and password will be pulled into the CloudantProducer class: -[source, text] ----- -cloudant.user=admin -cloudant.password={aes}AEEjCqvh7XAwDxrdYC6BUbqYlwqI8NAxRkWWWq7muxZu ----- == No need for a Cloudant feature -Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant Java Driver API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using newer versions of Cloudant with a CDI producer. +Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant Java Driver API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using the new Cloudant SDK for Java. -The Cloudant client should be bundled in your application. To do this with Maven you can use a dependency: +The Cloudant SDK for Java should be bundled in your application. To do this with Maven you can use a dependency: [source, xml] ---- From 753eb7709fd1e9f3c36b3f7cf6ca4ff1fed38bf7 Mon Sep 17 00:00:00 2001 From: revijay Date: Tue, 26 Nov 2024 09:41:50 +0530 Subject: [PATCH 03/28] Incorporated review comments --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index b4c1b49f8..23dc0a89a 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -42,11 +42,6 @@ public class CloudantProducer { @ConfigProperty(name = "cloudant.password") String encodedPassword; - - @Inject - @ConfigProperty(name = "cloudant.dbname") - String dbname; - @Produces public Cloudant createCloudant() { String password = PasswordUtil.passwordDecode(encodedPassword); @@ -62,7 +57,7 @@ public class CloudantProducer { } } ---- -One of the advantages of using a CDI producer is that it can be tailored to your needs. For improved security,the createCloudant method is enhanced to include authentication with a user name and password. This requires the following Maven dependency: +One of the advantages of using a CDI producer is that it can be tailored to your needs. For improved security,the createCloudant method uses Open Liberty's password decoding. This requires the following Maven dependency: [source,xml] ---- @@ -81,6 +76,7 @@ Now, by placing the following snippet in your ``microprofile-config.properties`` ---- cloudant.user=admin cloudant.password={aes}AEEjCqvh7XAwDxrdYC6BUbqYlwqI8NAxRkWWWq7muxZu +cloudant.dbname=testdb ---- == Injecting the Cloudant client @@ -90,6 +86,10 @@ Here is an example of using the CDI producer to inject a Cloudant client in a JA @Inject Cloudant client; +@Inject +@ConfigProperty(name = "cloudant.dbname") +String dbname; + @POST @Path("/add") @Consumes(MediaType.APPLICATION_JSON) @@ -153,7 +153,7 @@ In the above example: * The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (_rev) of the document to ensure that the correct version is deleted (to prevent race conditions). This class uses the builder pattern to set options before sending the delete request to Cloudant. == No need for a Cloudant feature -Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant Java Driver API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using the new Cloudant SDK for Java. +Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant SDK for Java's API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using the new Cloudant SDK for Java. The Cloudant SDK for Java should be bundled in your application. To do this with Maven you can use a dependency: @@ -165,7 +165,7 @@ The Cloudant SDK for Java should be bundled in your application. To do this with x.x.x ---- -If you have multiple applications accessing Cloudant, instead of bundling the Cloudant client library, you can configure a shared library in your `server.xml` like this: +If you have multiple applications accessing Cloudant, instead of bundling the Cloudant SDK for Java with each application, you can configure a shared library in your `server.xml` like this: [source, xml] ---- From 546fb88342977d4786ce6e1b3ebe81be8828d60c Mon Sep 17 00:00:00 2001 From: revijay Date: Wed, 27 Nov 2024 00:07:46 +0530 Subject: [PATCH 04/28] Updated blog to add an intro and summary section --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 23dc0a89a..4a3b5cf63 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -16,6 +16,8 @@ Reshmi Vijayan :url-prefix: :url-about: / +Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a powerful solution for document-oriented storage with high availability and scalability. Cloudant provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Its ability to scale flawless, offer high availability, and support real-time data access makes it a perfect fit for dynamic, modern applications running in the cloud. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient, scalable data storage. + Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. == A CDI producer for Cloudant @@ -181,5 +183,11 @@ If you have multiple applications accessing Cloudant, instead of bundling the Cl ---- -This illustrates how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config that help you to integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. -The full sample is available on GitHub here:link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant] \ No newline at end of file +== Summary +In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config that help you to integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. +The full sample is available on GitHub here:link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant]. + +By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. + +== Next Steps +As your application evolves, consider exploring more advanced capabilities of both Cloudant and Open Liberty to unlock their full potential in building resilient, high-performance cloud-native applications. Whether you're scaling your infrastructure, improving security, or enhancing performance, the possibilities are vast for developers leveraging these technologies together. \ No newline at end of file From 6a45f8465a873d24d9a0c09318716e21d0097805 Mon Sep 17 00:00:00 2001 From: revijay Date: Wed, 27 Nov 2024 13:52:47 +0530 Subject: [PATCH 05/28] Updated introduction and added some more information in the blog --- ...2024-11-25-cloudant-with-open-liberty.adoc | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 4a3b5cf63..9bf4b30e2 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -16,7 +16,7 @@ Reshmi Vijayan :url-prefix: :url-about: / -Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a powerful solution for document-oriented storage with high availability and scalability. Cloudant provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Its ability to scale flawless, offer high availability, and support real-time data access makes it a perfect fit for dynamic, modern applications running in the cloud. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient, scalable data storage. +Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a powerful solution for document-oriented storage with high availability and scalability. Cloudant provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient, scalable data storage. Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. @@ -81,6 +81,41 @@ cloudant.password={aes}AEEjCqvh7XAwDxrdYC6BUbqYlwqI8NAxRkWWWq7muxZu cloudant.dbname=testdb ---- +Instead of using `BasicAuthentication` with a username and password, Cloudant also supports `IAM (Identity and Access Management)` authentication, which allows users and applications to authenticate using secure API keys or IAM tokens. By using IAM authentication, we can avoid the risks associated with managing passwords and ensure that only authorized entities can interact with Cloudant databases. +Follow https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant&_ga=2.42518757.1165320250.1604321683-1614077795.1594908456[IBM Cloudant Setup] guide to create a Cloudant instance and API key for accessing it. + +Bellow code snippet shows how can we create a CDI Producer to inject Cloudant client with IAM authenticator. +[source, java] +---- +@ApplicationScoped +public class CloudantProducer { + + @Inject + @ConfigProperty(name = "cloudant.host", defaultValue = "localhost") + String host; + + @Inject + @ConfigProperty(name = "cloudant.port", defaultValue = "5984") + String port; + + @Inject + @ConfigProperty(name = "cloudant.apikey") + String apikey; + + @Produces + public Cloudant createCloudant() { + IamAuthenticator authenticator = new IamAuthenticator.Builder() + .apikey("apikey") + .build(); + + Cloudant service = new Cloudant("cloudant", authenticator); + service.setServiceUrl("http://" + host + ":" + port); + + return service; + } +} +---- + == Injecting the Cloudant client Here is an example of using the CDI producer to inject a Cloudant client in a JAX-RS application. [source, java] @@ -106,7 +141,7 @@ public void add(CrewMember crewMember) { .db(dbname) .document(newCrewMember) .build(); - DocumentResult createDocumentResponse = client + DocumentResult createDocumentResponse = client .postDocument(createDocumentOptions) .execute() .getResult(); @@ -187,7 +222,4 @@ If you have multiple applications accessing Cloudant, instead of bundling the Cl In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config that help you to integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. The full sample is available on GitHub here:link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant]. -By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. - -== Next Steps -As your application evolves, consider exploring more advanced capabilities of both Cloudant and Open Liberty to unlock their full potential in building resilient, high-performance cloud-native applications. Whether you're scaling your infrastructure, improving security, or enhancing performance, the possibilities are vast for developers leveraging these technologies together. \ No newline at end of file +By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. \ No newline at end of file From 4a50e247224f482600564108e48227419ab490ca Mon Sep 17 00:00:00 2001 From: revijay Date: Wed, 27 Nov 2024 20:29:31 +0530 Subject: [PATCH 06/28] Incorporated review comments --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 9bf4b30e2..439ee413e 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -82,9 +82,9 @@ cloudant.dbname=testdb ---- Instead of using `BasicAuthentication` with a username and password, Cloudant also supports `IAM (Identity and Access Management)` authentication, which allows users and applications to authenticate using secure API keys or IAM tokens. By using IAM authentication, we can avoid the risks associated with managing passwords and ensure that only authorized entities can interact with Cloudant databases. -Follow https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant&_ga=2.42518757.1165320250.1604321683-1614077795.1594908456[IBM Cloudant Setup] guide to create a Cloudant instance and API key for accessing it. +Follow the https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant&_ga=2.42518757.1165320250.1604321683-1614077795.1594908456[IBM Cloudant Setup] guide to create a Cloudant instance and API key for accessing it. -Bellow code snippet shows how can we create a CDI Producer to inject Cloudant client with IAM authenticator. +The code snippet below shows how can we create a CDI Producer to inject a Cloudant client with IAM authentication. [source, java] ---- @ApplicationScoped @@ -104,7 +104,7 @@ public class CloudantProducer { @Produces public Cloudant createCloudant() { - IamAuthenticator authenticator = new IamAuthenticator.Builder() + IamAuthenticator authenticator = new IamAuthenticator.Builder() .apikey("apikey") .build(); @@ -219,7 +219,7 @@ If you have multiple applications accessing Cloudant, instead of bundling the Cl ---- == Summary -In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config that help you to integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. -The full sample is available on GitHub here:link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant]. +In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config to help integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. +The full sample is available on GitHub here: link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant]. By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. \ No newline at end of file From f9125dc109fc61745a567d352244e910abd05c74 Mon Sep 17 00:00:00 2001 From: Mark Swatosh Date: Wed, 27 Nov 2024 09:52:42 -0600 Subject: [PATCH 07/28] Remove unnecessary URL params --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 439ee413e..a27a3a8a4 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -82,7 +82,7 @@ cloudant.dbname=testdb ---- Instead of using `BasicAuthentication` with a username and password, Cloudant also supports `IAM (Identity and Access Management)` authentication, which allows users and applications to authenticate using secure API keys or IAM tokens. By using IAM authentication, we can avoid the risks associated with managing passwords and ensure that only authorized entities can interact with Cloudant databases. -Follow the https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant&_ga=2.42518757.1165320250.1604321683-1614077795.1594908456[IBM Cloudant Setup] guide to create a Cloudant instance and API key for accessing it. +Follow the https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant[IBM Cloudant Setup] guide to create a Cloudant instance and API key for accessing it. The code snippet below shows how can we create a CDI Producer to inject a Cloudant client with IAM authentication. [source, java] From 2194585aa999a33b27e17c7689dca8e030058366 Mon Sep 17 00:00:00 2001 From: revijay Date: Thu, 28 Nov 2024 16:02:57 +0530 Subject: [PATCH 08/28] committed some minor changes in the code when working with IAM --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 439ee413e..092a08a3d 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -91,13 +91,9 @@ The code snippet below shows how can we create a CDI Producer to inject a Clouda public class CloudantProducer { @Inject - @ConfigProperty(name = "cloudant.host", defaultValue = "localhost") + @ConfigProperty(name = "cloudant.host") String host; - @Inject - @ConfigProperty(name = "cloudant.port", defaultValue = "5984") - String port; - @Inject @ConfigProperty(name = "cloudant.apikey") String apikey; @@ -109,7 +105,7 @@ public class CloudantProducer { .build(); Cloudant service = new Cloudant("cloudant", authenticator); - service.setServiceUrl("http://" + host + ":" + port); + service.setServiceUrl("https://" + host); return service; } From 4d006468f34d32654431c30ec9da9049c2dcedc0 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 09:56:57 +0530 Subject: [PATCH 09/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index f0a0c2fd2..ea090f2ac 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -16,7 +16,7 @@ Reshmi Vijayan :url-prefix: :url-about: / -Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a powerful solution for document-oriented storage with high availability and scalability. Cloudant provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient, scalable data storage. +Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient scalable data storage. Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. From b4e8d46f64b12139a91729614dfae58dedb60451 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 10:06:15 +0530 Subject: [PATCH 10/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index ea090f2ac..131cac9f9 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -18,7 +18,7 @@ Reshmi Vijayan Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient scalable data storage. -Using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. +Previously, using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). == A CDI producer for Cloudant With a CDI producer, you can easily provide a Cloudant client to your application by which you can inject the client into various parts of the application in a type-safe and flexible way, while leveraging the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to make the configuration of Cloudant driver simple. From f346a674a988b6b5c3c28099b28d8cd5eb413743 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 10:07:25 +0530 Subject: [PATCH 11/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 131cac9f9..4a8e652c7 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -21,7 +21,7 @@ Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides Previously, using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). == A CDI producer for Cloudant -With a CDI producer, you can easily provide a Cloudant client to your application by which you can inject the client into various parts of the application in a type-safe and flexible way, while leveraging the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to make the configuration of Cloudant driver simple. +With a CDI producer, you can easily provide a Cloudant client to your application and inject the client into various parts of the application in a type-safe and flexible way, with the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to simplify the configuration of the Cloudant driver. This example demonstrates how to create a CDI producer to inject a Cloudant client: [source, java] ---- From 5fec7c7e02ea3d586d357c3d5c5c72878235a15f Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 11:01:12 +0530 Subject: [PATCH 12/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 4a8e652c7..ed86fe18b 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -59,7 +59,7 @@ public class CloudantProducer { } } ---- -One of the advantages of using a CDI producer is that it can be tailored to your needs. For improved security,the createCloudant method uses Open Liberty's password decoding. This requires the following Maven dependency: +One advantage of using a CDI producer is that you can tailor it to your needs. For improved security, the `createCloudant` method uses Open Liberty's password decoding, which requires the following Maven dependency: [source,xml] ---- From e101667f8187e2fe86ee1d09fde2c146d8e4db05 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 11:01:48 +0530 Subject: [PATCH 13/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index ed86fe18b..d8885f5b5 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -68,7 +68,7 @@ One advantage of using a CDI producer is that you can tailor it to your needs. F 1.0.95 ---- -You also need to enable the feature in `server.xml`: +You must also enable the Password Utilities feature in your `server.xml`file: [source, xml] ---- passwordUtilities-1.0 From d4d0009ff5cbb47ff7fe260da4fbf12309b941d8 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 11:02:08 +0530 Subject: [PATCH 14/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index d8885f5b5..fa86dd31b 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -180,7 +180,7 @@ public String remove(@PathParam("id") String id) { .getResult(); } ---- -In the above example: +In the previous example: * The `GetDocumentOptions` class is used to configure parameters for retrieving a document from a Cloudant database. It allows you to specify the database name, document ID, and optional parameters like the document revision, whether to include attachments, conflicts, or deleted information in the response. The class uses the builder pattern to set these options before making the request to Cloudant. * The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (_rev) of the document to ensure that the correct version is deleted (to prevent race conditions). This class uses the builder pattern to set options before sending the delete request to Cloudant. From 78da96d133a5832190c3033b796f0726f67a263b Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 11:03:06 +0530 Subject: [PATCH 15/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index fa86dd31b..9e81a4d70 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -183,7 +183,7 @@ public String remove(@PathParam("id") String id) { In the previous example: * The `GetDocumentOptions` class is used to configure parameters for retrieving a document from a Cloudant database. It allows you to specify the database name, document ID, and optional parameters like the document revision, whether to include attachments, conflicts, or deleted information in the response. The class uses the builder pattern to set these options before making the request to Cloudant. -* The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (_rev) of the document to ensure that the correct version is deleted (to prevent race conditions). This class uses the builder pattern to set options before sending the delete request to Cloudant. +* The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (`_rev`) of the document to ensure that the correct version is deleted and prevent race conditions. This class uses the builder pattern to set options before sending the delete request to Cloudant. == No need for a Cloudant feature Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant SDK for Java's API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using the new Cloudant SDK for Java. From 37cd405a6794601e7d29e3d2a13c910302571c50 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 11:03:40 +0530 Subject: [PATCH 16/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 9e81a4d70..046c5a739 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -188,7 +188,7 @@ In the previous example: == No need for a Cloudant feature Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant SDK for Java's API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using the new Cloudant SDK for Java. -The Cloudant SDK for Java should be bundled in your application. To do this with Maven you can use a dependency: +Bundle the Cloudant SDK for Java in your application. To do this with Maven you can use a dependency: [source, xml] ---- From 51ba3ce2905e872f7e66c275ba88881f10e1876e Mon Sep 17 00:00:00 2001 From: revijay Date: Wed, 4 Dec 2024 12:15:43 +0530 Subject: [PATCH 17/28] Updated based on review comments --- ...2024-11-25-cloudant-with-open-liberty.adoc | 71 ++++++++++++------- 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 046c5a739..cae381b60 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -20,6 +20,47 @@ Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides Previously, using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). +== Bundle the Cloudant SDK for Java + +Prior to implementing the functionality, make sure to configure the essential dependencies in your application. Depending on your build tool (Maven or Gradle), you can include the necessary Cloudant SDK libraries by adding the corresponding dependency. + +* For Maven: Add the below dependency in pom.xml file: + +[source, xml] +---- + + com.ibm.cloud + cloudant + x.x.x + +---- +Be sure to check for the latest version on link:https://central.sonatype.com/?smo=true[Maven Central]. + +* For Gradle: In your build.gradle file, add the following inside the dependencies block: + +[source, groovy] +---- +dependencies { + implementation 'com.ibm.cloud:ibm-cloud-sdk-core:x.x.x' +} +---- + +If you have multiple applications accessing Cloudant, instead of bundling the Cloudant SDK for Java with each application, you can configure a shared library in your `server.xml` like this: +[source, xml] +---- + + + + + + + + + + + +---- + == A CDI producer for Cloudant With a CDI producer, you can easily provide a Cloudant client to your application and inject the client into various parts of the application in a type-safe and flexible way, with the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to simplify the configuration of the Cloudant driver. This example demonstrates how to create a CDI producer to inject a Cloudant client: @@ -186,36 +227,14 @@ In the previous example: * The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (`_rev`) of the document to ensure that the correct version is deleted and prevent race conditions. This class uses the builder pattern to set options before sending the delete request to Cloudant. == No need for a Cloudant feature -Previously, using Cloudant required enabling the `cloudant-1.0` feature. Even if the Cloudant SDK for Java's API changes, simple updates to your CDI producer will allow it to continue to work. You should remove the `cloudant-1.0` feature from your `server.xml` when using the new Cloudant SDK for Java. - -Bundle the Cloudant SDK for Java in your application. To do this with Maven you can use a dependency: - -[source, xml] ----- - - com.ibm.cloud - cloudant - x.x.x - ----- -If you have multiple applications accessing Cloudant, instead of bundling the Cloudant SDK for Java with each application, you can configure a shared library in your `server.xml` like this: -[source, xml] ----- - - - +Previously, integrating Cloudant into your application required enabling the `cloudant-1.0` feature in the `server.xml` file. The CDI producer now automates the integration process, allowing you to inject Cloudant resources directly into your application without needing to explicitly enable the `cloudant-1.0` feature. - - - +What makes this approach even more flexible is that, even if the Cloudant SDK for Java’s API undergoes changes in the future, you won’t need to make extensive updates to your application code, meaning that simple updates to the producer itself will be sufficient to ensure continued compatibility with newer versions of the SDK. - - - ----- +As a result, when migrating to the new Cloudant SDK for Java, it is recommended that you remove the `cloudant-1.0` feature from your server.xml file. This not only streamlines your configuration but also aligns with the new, simplified approach of using the Cloudant CDI producer for integration. == Summary In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config to help integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. -The full sample is available on GitHub here: link:https://github.com/OpenLiberty/sample-cloudant[https://github.com/OpenLiberty/sample-cloudant]. +The full sample is available link:https://github.com/OpenLiberty/sample-cloudant[on GitHub]. By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. \ No newline at end of file From 5ee3fddd49b30b1720e12b49a225b5c1c4cd3c1a Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Wed, 4 Dec 2024 12:45:54 +0530 Subject: [PATCH 18/28] Update 2024-11-25-cloudant-with-open-liberty.adoc Removed extra line --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index cae381b60..1475cd261 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -227,9 +227,7 @@ In the previous example: * The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (`_rev`) of the document to ensure that the correct version is deleted and prevent race conditions. This class uses the builder pattern to set options before sending the delete request to Cloudant. == No need for a Cloudant feature -Previously, integrating Cloudant into your application required enabling the `cloudant-1.0` feature in the `server.xml` file. The CDI producer now automates the integration process, allowing you to inject Cloudant resources directly into your application without needing to explicitly enable the `cloudant-1.0` feature. - -What makes this approach even more flexible is that, even if the Cloudant SDK for Java’s API undergoes changes in the future, you won’t need to make extensive updates to your application code, meaning that simple updates to the producer itself will be sufficient to ensure continued compatibility with newer versions of the SDK. +Previously, integrating Cloudant into your application required enabling the `cloudant-1.0` feature in the `server.xml` file. The CDI producer now automates the integration process, allowing you to inject Cloudant resources directly into your application without needing to explicitly enable the `cloudant-1.0` feature. What makes this approach even more flexible is that, even if the Cloudant SDK for Java’s API undergoes changes in the future, you won’t need to make extensive updates to your application code, meaning that simple updates to the producer itself will be sufficient to ensure continued compatibility with newer versions of the SDK. As a result, when migrating to the new Cloudant SDK for Java, it is recommended that you remove the `cloudant-1.0` feature from your server.xml file. This not only streamlines your configuration but also aligns with the new, simplified approach of using the Cloudant CDI producer for integration. @@ -237,4 +235,4 @@ As a result, when migrating to the new Cloudant SDK for Java, it is recommended In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config to help integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. The full sample is available link:https://github.com/OpenLiberty/sample-cloudant[on GitHub]. -By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. \ No newline at end of file +By combining the strengths of Cloudant and Open Liberty, developers can create powerful, cloud-native applications that are both flexible and scalable, with minimal infrastructure management. This integration ensures real-time data access, robust data storage, and seamless scaling—all essential for modern, data-driven applications in the cloud. From 5b6411ec32c49870e884c531f4ee292ff2d59e7d Mon Sep 17 00:00:00 2001 From: Miyuka Nishio Date: Wed, 4 Dec 2024 17:14:46 +0900 Subject: [PATCH 19/28] Copy 2024-12-03-24.0.0.12.adoc from global to ja directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻訳をするためにファイルをコピー --- posts/ja/2024-12-03-24.0.0.12.adoc | 127 +++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 posts/ja/2024-12-03-24.0.0.12.adoc diff --git a/posts/ja/2024-12-03-24.0.0.12.adoc b/posts/ja/2024-12-03-24.0.0.12.adoc new file mode 100644 index 000000000..374e2f3f2 --- /dev/null +++ b/posts/ja/2024-12-03-24.0.0.12.adoc @@ -0,0 +1,127 @@ +--- +layout: post +title: "MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12" +# Do NOT change the categories section +categories: blog +author_picture: https://avatars3.githubusercontent.com/dmuelle +author_github: https://github.com/dmuelle +seo-title: MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12 - OpenLiberty.io +seo-description: The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. +blog_description: The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. +open-graph-image: https://openliberty.io/img/twitter_card.jpg +open-graph-image-alt: Open Liberty Logo +--- += MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12 +David Mueller +:imagesdir: / +:url-prefix: +:url-about: / +//Blank line here is necessary before starting the body of the post. + +The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. + +In link:{url-about}[Open Liberty] 24.0.0.12: + +* <> +* <> +* <> + +View the list of fixed bugs in link:https://github.com/OpenLiberty/open-liberty/issues?q=label%3Arelease%3A240012+label%3A%22release+bug%22[24.0.0.12]. + +Check out link:{url-prefix}/blog/?search=release&search!=beta[previous Open Liberty GA release blog posts]. + + +[#run] +== Develop and run your apps using 24.0.0.12 + +If you're using link:{url-prefix}/guides/maven-intro.html[Maven], include the following in your `pom.xml` file: + +[source,xml] +---- + + io.openliberty.tools + liberty-maven-plugin + 3.11.1 + +---- + +Or for link:{url-prefix}/guides/gradle-intro.html[Gradle], include the following in your `build.gradle` file: + +[source,gradle] +---- +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'io.openliberty.tools:liberty-gradle-plugin:3.9.1' + } +} +apply plugin: 'liberty' +---- + +Or if you're using link:{url-prefix}/docs/latest/container-images.html[container images]: + +[source] +---- +FROM icr.io/appcafe/open-liberty +---- + +Or take a look at our link:{url-prefix}/start/[Downloads page]. + +If you're using link:https://plugins.jetbrains.com/plugin/14856-liberty-tools[IntelliJ IDEA], link:https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext[Visual Studio Code] or link:https://marketplace.eclipse.org/content/liberty-tools[Eclipse IDE], you can also take advantage of our open source link:https://openliberty.io/docs/latest/develop-liberty-tools.html[Liberty developer tools] to enable effective development, testing, debugging, and application management all from within your IDE. + +[link=https://stackoverflow.com/tags/open-liberty] +image::img/blog/blog_btn_stack.svg[Ask a question on Stack Overflow, align="center"] + + +[#mp7] +== Develop your microservice applications with MicroProfile 7.0 + +MicroProfile provides a set of APIs and tools for developing, deploying, and managing microservices in a lightweight and efficient manner. The 24.0.0.12 release adds support for the MicroProfile programming model version 7.0, a major release. It replaces MicroProfile Metrics with MicroProfile Telemetry. Therefore, MicroProfile Metrics moves out of the umbrella release and becomes a stand-alone specification. This release also introduces the new versions of the MicroProfile OpenAPI, Rest Client, Fault Tolerance, and Telemetry features. For more information, see link:{url-prefix}/blog/2024/12/03/microprofile-7.html[MicroProfile 7.0 deep dive with Open Liberty]. + +// DO NOT MODIFY THIS LINE. + +// // // // DO NOT MODIFY THIS COMMENT BLOCK // // // // +// Blog issue: https://github.com/OpenLiberty/open-liberty/issues/30255 +// Contact/Reviewer: volosied,pnicolucci +// // // // // // // // +[#samesite] +== Check for Samesite=None incompatible clients + +In 24.0.0.12, you can now use `SameSite=None` cookies without the worry of breaking certain client versions. Previously, cookies with the `SameSite=None` attribute were rejected or mishandled (treated as `SameSite=Strict`) if they were sent to an link:https://www.chromium.org/updates/same-site/incompatible-clients/[incompatible client version]. Now, Open Liberty intercepts cookies with the `SameSite=None` attribute before they are sent to the web browser and checks if the `User-Agent` specifies an incompatible client version. If an incompatible client is detected, the `SameSite=None` and `Partitioned` headers (if present) are removed from the cookie. + +For more information, see link:{url-prefix}/blog/2020/03/25/set-samesite-attribute-cookies-liberty.html[Setting the SameSite attribute on cookies with Open Liberty]. +// DO NOT MODIFY THIS LINE. + + + +[#CVEs] +== Security vulnerability (CVE) fixes in this release +[cols="5*"] +|=== +|CVE |CVSS Score |Vulnerability Assessment |Versions Affected |Notes + +|link:https://www.cve.org/CVERecord?id=CVE-2024-7254[CVE-2024-7254] +|7.5 +|Denial of service +|20.0.0.12 - 24.0.0.10 +|Affects the `grpc-1.0` and `grpcClient-1.0` features +|=== + +// // // // // // // // +// In the preceding section: +// If there were any CVEs addressed in this release, fill out the table. For the information, reference https://github.com/OpenLiberty/docs/blob/draft/modules/ROOT/pages/security-vulnerabilities.adoc. If it has not been updated for this release, reach out to Kristen Clarke or Michal Broz. +// Note: When linking to features, use the +// `link:{url-prefix}/docs/latest/reference/feature/someFeature-1.0.html[Some Feature 1.0]` format and +// NOT what security-vulnerabilities.adoc does (feature:someFeature-1.0[]) +// +// If there are no CVEs fixed in this release, replace the table with: +// "There are no security vulnerability fixes in Open Liberty [24.0.0.12]." +// // // // // // // // +For a list of past security vulnerability fixes, reference the link:{url-prefix}/docs/latest/security-vulnerabilities.html[Security vulnerability (CVE) list]. + + +== Get Open Liberty 24.0.0.12 now + +Available through <>. From 4f3d721b6aa457726be50afe1ff19d84583eb2d5 Mon Sep 17 00:00:00 2001 From: Miyuka Nishio Date: Thu, 5 Dec 2024 15:27:44 +0900 Subject: [PATCH 20/28] Complete 2024-12-03-24.0.0.12.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻訳の完了 --- posts/ja/2024-12-03-24.0.0.12.adoc | 70 +++++++++++++++++------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/posts/ja/2024-12-03-24.0.0.12.adoc b/posts/ja/2024-12-03-24.0.0.12.adoc index 374e2f3f2..55a083f40 100644 --- a/posts/ja/2024-12-03-24.0.0.12.adoc +++ b/posts/ja/2024-12-03-24.0.0.12.adoc @@ -1,40 +1,47 @@ --- layout: post -title: "MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12" +title: "24.0.0.12でのMicroProfile 7.0とSameSite Cookie処理の改善" # Do NOT change the categories section categories: blog author_picture: https://avatars3.githubusercontent.com/dmuelle author_github: https://github.com/dmuelle -seo-title: MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12 - OpenLiberty.io -seo-description: The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. -blog_description: The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. +seo-title: 24.0.0.12でのMicroProfile 7.0とSameSite Cookie処理の改善 - OpenLiberty.io +seo-description: 24.0.0.12リリースでは、MicroProfileのメジャー・リリースであるMicroProfile 7.0のサポートが追加されました。また、SameSite Cookieを使用する際に互換性のないクライアント・バージョンを処理する方法も提供されます。 +blog_description: 24.0.0.12リリースでは、MicroProfileのメジャー・リリースであるMicroProfile 7.0のサポートが追加されました。また、SameSite Cookieを使用する際に互換性のないクライアント・バージョンを処理する方法も提供されます。 open-graph-image: https://openliberty.io/img/twitter_card.jpg open-graph-image-alt: Open Liberty Logo +additional_authors: +- name: 西尾 実優香 (翻訳) + github: https://github.com/MiyukaNishio + image: https://avatars.githubusercontent.com/MiyukaNishio +blog-available-in-languages: +- lang: en + path: /blog/2024/12/03/24.0.0.12.html --- -= MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12 += 24.0.0.12でのMicroProfile 7.0とSameSite Cookie処理の改善 David Mueller :imagesdir: / :url-prefix: :url-about: / //Blank line here is necessary before starting the body of the post. -The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. +24.0.0.12リリースでは、MicroProfileのメジャー・リリースであるMicroProfile 7.0のサポートが追加されました。また、SameSite Cookieを使用する際に互換性のないクライアント・バージョンを処理する方法も提供されます。 -In link:{url-about}[Open Liberty] 24.0.0.12: +link:{url-about}[Open Liberty] 24.0.0.12では以下のアップデートが行われました。 -* <> -* <> -* <> +* <> +* <> +* <> -View the list of fixed bugs in link:https://github.com/OpenLiberty/open-liberty/issues?q=label%3Arelease%3A240012+label%3A%22release+bug%22[24.0.0.12]. +link:https://github.com/OpenLiberty/open-liberty/issues?q=label%3Arelease%3A240012+label%3A%22release+bug%22[24.0.0.12]で修正されたバグの一覧をご確認ください。 -Check out link:{url-prefix}/blog/?search=release&search!=beta[previous Open Liberty GA release blog posts]. +link:{url-prefix}/blog/?search=release&search!=beta[以前のOpen Liberty GAリリースのブログ投稿]をご覧ください。 [#run] -== Develop and run your apps using 24.0.0.12 +== 24.0.0.12を使用してアプリを開発および実行する -If you're using link:{url-prefix}/guides/maven-intro.html[Maven], include the following in your `pom.xml` file: +link:{url-prefix}/guides/maven-intro.html[Maven] を使用している場合は、`pom.xml` ファイルに以下の内容を含めます。 [source,xml] ---- @@ -45,7 +52,7 @@ If you're using link:{url-prefix}/guides/maven-intro.html[Maven], include the fo ---- -Or for link:{url-prefix}/guides/gradle-intro.html[Gradle], include the following in your `build.gradle` file: +link:{url-prefix}/guides/gradle-intro.html[Gradle] を使用している場合は、`build.gradle` ファイルに以下の内容を含めます。 [source,gradle] ---- @@ -60,25 +67,27 @@ buildscript { apply plugin: 'liberty' ---- -Or if you're using link:{url-prefix}/docs/latest/container-images.html[container images]: +link:{url-prefix}/docs/latest/container-images.html[コンテナ イメージ] を使用している場合: [source] ---- FROM icr.io/appcafe/open-liberty ---- -Or take a look at our link:{url-prefix}/start/[Downloads page]. +または、link:{url-prefix}/start/[ダウンロード・ページ]をご覧ください。 -If you're using link:https://plugins.jetbrains.com/plugin/14856-liberty-tools[IntelliJ IDEA], link:https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext[Visual Studio Code] or link:https://marketplace.eclipse.org/content/liberty-tools[Eclipse IDE], you can also take advantage of our open source link:https://openliberty.io/docs/latest/develop-liberty-tools.html[Liberty developer tools] to enable effective development, testing, debugging, and application management all from within your IDE. +link:https://plugins.jetbrains.com/plugin/14856-liberty-tools[IntelliJ IDEA]、link:https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext[Visual Studio Code]、または link:https://marketplace.eclipse.org/content/liberty-tools[Eclipse IDE]を使用している場合は、オープンソースの link:https://openliberty.io/docs/latest/develop-liberty-tools.html[Liberty 開発者ツール] を活用して、IDE 内から効果的な開発、テスト、デバッグ、アプリケーション管理を行うこともできます。 [link=https://stackoverflow.com/tags/open-liberty] -image::img/blog/blog_btn_stack.svg[Ask a question on Stack Overflow, align="center"] +image::img/blog/blog_btn_stack_ja.svg[Stack Overflowで質問する, align="center"] [#mp7] -== Develop your microservice applications with MicroProfile 7.0 +== MicroProfile 7.0でマイクロサービス・アプリケーションを開発 -MicroProfile provides a set of APIs and tools for developing, deploying, and managing microservices in a lightweight and efficient manner. The 24.0.0.12 release adds support for the MicroProfile programming model version 7.0, a major release. It replaces MicroProfile Metrics with MicroProfile Telemetry. Therefore, MicroProfile Metrics moves out of the umbrella release and becomes a stand-alone specification. This release also introduces the new versions of the MicroProfile OpenAPI, Rest Client, Fault Tolerance, and Telemetry features. For more information, see link:{url-prefix}/blog/2024/12/03/microprofile-7.html[MicroProfile 7.0 deep dive with Open Liberty]. +MicroProfileは、マイクロサービスを軽量かつ効率的に開発、デプロイ、および管理するためのAPIとツールのセットを提供します。バージョン24.0.0.12リリースでは、MicroProfileのメジャー・リリースであるMicroProfile 7.0のサポートが追加されました。これにより、MicroProfile MetricsがMicroProfile Telemetryに置き換えられました。 したがって、MicroProfile Metricsは包括的なリリースから外れ、独立した仕様となります。このリリースでは、MicroProfile OpenAPI、Rest Client、Fault Tolerance、およびTelemetry機能の新バージョンも導入されました。 + +詳しくは、link:{url-prefix}/blog/2024/12/03/microprofile-7.html[Open Libertyを使用したMicroProfile 7.0の詳細]をご参照ください。 // DO NOT MODIFY THIS LINE. @@ -87,18 +96,21 @@ MicroProfile provides a set of APIs and tools for developing, deploying, and man // Contact/Reviewer: volosied,pnicolucci // // // // // // // // [#samesite] -== Check for Samesite=None incompatible clients +== SameSite=Noneの非互換クライアントを確認 -In 24.0.0.12, you can now use `SameSite=None` cookies without the worry of breaking certain client versions. Previously, cookies with the `SameSite=None` attribute were rejected or mishandled (treated as `SameSite=Strict`) if they were sent to an link:https://www.chromium.org/updates/same-site/incompatible-clients/[incompatible client version]. Now, Open Liberty intercepts cookies with the `SameSite=None` attribute before they are sent to the web browser and checks if the `User-Agent` specifies an incompatible client version. If an incompatible client is detected, the `SameSite=None` and `Partitioned` headers (if present) are removed from the cookie. +バージョン24.0.0.12では、特定のクライアントバージョンに対して問題が発生することを心配することなく、 `SameSite=None` のCookieを使用できるようになりました。以前は、 `SameSite=None` 属性を持つCookieがlink:https://www.chromium.org/updates/same-site/incompatible-clients/[非互換クライアント]に送信されると、拒否されたり誤って処理 ( `SameSite=Strict` として処理) されたりしていました。 今後はウェブブラウザに送信される前に、 `SameSite=None` 属性を持つCookieをOpen Libertyが傍受し、 `User-Agent` が非互換のクライアントバージョンを指定しているかどうかを確認します。非互換のクライアントが検出されると、 `SameSite=None` および `Partitioned` ヘッダー (存在する場合) はCookieから削除されます。 -For more information, see link:{url-prefix}/blog/2020/03/25/set-samesite-attribute-cookies-liberty.html[Setting the SameSite attribute on cookies with Open Liberty]. +詳しくは、link:{url-prefix}/blog/2020/03/25/set-samesite-attribute-cookies-liberty.html[Open LibertyでのCookieのSameSite属性の設定]をご参照ください。 // DO NOT MODIFY THIS LINE. [#CVEs] -== Security vulnerability (CVE) fixes in this release +== セキュリティ脆弱性 (CVE) の修正 [cols="5*"] + +以下のCVEが24.0.0.12のリリースで修正されました。 + |=== |CVE |CVSS Score |Vulnerability Assessment |Versions Affected |Notes @@ -106,7 +118,7 @@ For more information, see link:{url-prefix}/blog/2020/03/25/set-samesite-attribu |7.5 |Denial of service |20.0.0.12 - 24.0.0.10 -|Affects the `grpc-1.0` and `grpcClient-1.0` features +| `grpc-1.0` と `grpcClient-1.0` の機能に影響 |=== // // // // // // // // @@ -119,9 +131,9 @@ For more information, see link:{url-prefix}/blog/2020/03/25/set-samesite-attribu // If there are no CVEs fixed in this release, replace the table with: // "There are no security vulnerability fixes in Open Liberty [24.0.0.12]." // // // // // // // // -For a list of past security vulnerability fixes, reference the link:{url-prefix}/docs/latest/security-vulnerabilities.html[Security vulnerability (CVE) list]. +過去のセキュリティ脆弱性修正の一覧については、link:{url-prefix}/docs/latest/security-vulnerabilities.html[セキュリティ脆弱性 (CVE) リスト] を参照してください。 -== Get Open Liberty 24.0.0.12 now +== Open Liberty 24.0.0.12を今すぐ入手 -Available through <>. +<>のリンクから入手できます。 From 9bc637619582c217e9bdce985577a0a33656519c Mon Sep 17 00:00:00 2001 From: Miyuka Nishio Date: Thu, 5 Dec 2024 15:30:50 +0900 Subject: [PATCH 21/28] Update 2024-12-03-24.0.0.12.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻訳リンクを追加 --- posts/2024-12-03-24.0.0.12.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/posts/2024-12-03-24.0.0.12.adoc b/posts/2024-12-03-24.0.0.12.adoc index 374e2f3f2..a9c1156b2 100644 --- a/posts/2024-12-03-24.0.0.12.adoc +++ b/posts/2024-12-03-24.0.0.12.adoc @@ -10,6 +10,9 @@ seo-description: The 24.0.0.12 release introduces support for MicroProfile 7.0, blog_description: The 24.0.0.12 release introduces support for MicroProfile 7.0, a major MicroProfile release. It also provides a way to handle incompatible client versions when you use SameSite cookies. open-graph-image: https://openliberty.io/img/twitter_card.jpg open-graph-image-alt: Open Liberty Logo +blog-available-in-languages: +- lang: ja + path: /ja/blog/2024/12/03/24.0.0.12.html --- = MicroProfile 7.0 and improvements for SameSite cookie handling in 24.0.0.12 David Mueller From 15816ad2a4052206d8bf809e10cc0a5722c43db1 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Fri, 6 Dec 2024 20:54:48 +0530 Subject: [PATCH 22/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 1475cd261..1506701f5 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -18,7 +18,9 @@ Reshmi Vijayan Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient scalable data storage. -Previously, using Cloudant with Open Liberty previously meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). +Previously, using Cloudant with Open Liberty meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). + +As a result, if you are migrating from using the `cloudant-1.0` feature to the new Cloudant SDK for Java, you should remove the `cloudant-1.0` feature from your server.xml file. This not only streamlines your configuration but also aligns with the new simplified approach of using the Cloudant CDI producer for integration. == Bundle the Cloudant SDK for Java From af13019e15372124506f2e2df7d0606aedc2b200 Mon Sep 17 00:00:00 2001 From: Reshmi Vijayan Date: Fri, 6 Dec 2024 20:55:30 +0530 Subject: [PATCH 23/28] Update posts/2024-11-25-cloudant-with-open-liberty.adoc Co-authored-by: David Mueller <48686014+dmuelle@users.noreply.github.com> --- posts/2024-11-25-cloudant-with-open-liberty.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-11-25-cloudant-with-open-liberty.adoc index 1506701f5..dd864205f 100755 --- a/posts/2024-11-25-cloudant-with-open-liberty.adoc +++ b/posts/2024-11-25-cloudant-with-open-liberty.adoc @@ -193,7 +193,7 @@ In the above code: * The `PostDocumentOptions` is a builder class that allows you to specify various options when posting the document. You must provide the db name and the document content. * The `postDocument` is the main method that posts the document to the specified database. It returns a DocumentResult object which contains metadata about the inserted document (like its _id and _rev). -Similarly, we can delete a document from Cloudant using its `id`. +Similarly, we can delete a document from Cloudant by using the document `id`. [source, java] ---- @DELETE From 2ea7a9fe0a5a2666e44ef8bbb55447f5fe9f9680 Mon Sep 17 00:00:00 2001 From: revijay Date: Fri, 6 Dec 2024 21:22:52 +0530 Subject: [PATCH 24/28] Renamed post file name --- ...pen-liberty.adoc => 2024-12-9-cloudant-with-open-liberty.adoc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename posts/{2024-11-25-cloudant-with-open-liberty.adoc => 2024-12-9-cloudant-with-open-liberty.adoc} (100%) diff --git a/posts/2024-11-25-cloudant-with-open-liberty.adoc b/posts/2024-12-9-cloudant-with-open-liberty.adoc similarity index 100% rename from posts/2024-11-25-cloudant-with-open-liberty.adoc rename to posts/2024-12-9-cloudant-with-open-liberty.adoc From 8307d3761a8c0c9f82884e372f5da3b149190820 Mon Sep 17 00:00:00 2001 From: David Mueller Date: Fri, 6 Dec 2024 11:52:19 -0500 Subject: [PATCH 25/28] minor edits --- .../2024-12-9-cloudant-with-open-liberty.adoc | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/posts/2024-12-9-cloudant-with-open-liberty.adoc b/posts/2024-12-9-cloudant-with-open-liberty.adoc index dd864205f..95eb0e741 100755 --- a/posts/2024-12-9-cloudant-with-open-liberty.adoc +++ b/posts/2024-12-9-cloudant-with-open-liberty.adoc @@ -18,15 +18,15 @@ Reshmi Vijayan Cloudant, an IBM-managed NoSQL database built on top of Apache CouchDB, provides a robust, flexible, and highly scalable NoSQL database solution that is tailor-made for cloud-native applications. Cloudant with Open Liberty offers a seamless way to build, deploy, and scale your Java applications with efficient scalable data storage. -Previously, using Cloudant with Open Liberty meant enabling the `cloudant-1.0` feature and configuring several elements in ``server.xml``. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). +Previously, using Cloudant with Open Liberty meant enabling the `cloudant-1.0` feature and configuring several elements in the `server.xml` file. The `cloudant-1.0` feature was implemented using Java Cloudant Client library, which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer (for an introduction to using CDI producers, see the https://openliberty.io/guides/cdi-intro.html[Injecting Dependencies into Microservices guide]). -As a result, if you are migrating from using the `cloudant-1.0` feature to the new Cloudant SDK for Java, you should remove the `cloudant-1.0` feature from your server.xml file. This not only streamlines your configuration but also aligns with the new simplified approach of using the Cloudant CDI producer for integration. +As a result, if you are migrating from using the `cloudant-1.0` feature to the new Cloudant SDK for Java, you should remove the `cloudant-1.0` feature from your server.xml file. This not only streamlines your configuration but also aligns with the new simplified approach of using the Cloudant CDI producer for integration. == Bundle the Cloudant SDK for Java Prior to implementing the functionality, make sure to configure the essential dependencies in your application. Depending on your build tool (Maven or Gradle), you can include the necessary Cloudant SDK libraries by adding the corresponding dependency. -* For Maven: Add the below dependency in pom.xml file: +* For Maven: Add the following dependency in pom.xml file: [source, xml] ---- @@ -34,7 +34,7 @@ Prior to implementing the functionality, make sure to configure the essential de com.ibm.cloud cloudant x.x.x - + ---- Be sure to check for the latest version on link:https://central.sonatype.com/?smo=true[Maven Central]. @@ -64,7 +64,7 @@ If you have multiple applications accessing Cloudant, instead of bundling the Cl ---- == A CDI producer for Cloudant -With a CDI producer, you can easily provide a Cloudant client to your application and inject the client into various parts of the application in a type-safe and flexible way, with the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to simplify the configuration of the Cloudant driver. +With a CDI producer, you can easily provide a Cloudant client to your application and inject the client into various parts of the application in a type-safe and flexible way, with the benefits of dependency injection (such as lifecycle management and configuration). Also, we are using link:{url-prefix}/guides/microprofile-config-intro.html[MicroProfile Config] to simplify the configuration of the Cloudant driver. This example demonstrates how to create a CDI producer to inject a Cloudant client: [source, java] ---- @@ -111,7 +111,7 @@ One advantage of using a CDI producer is that you can tailor it to your needs. F 1.0.95 ---- -You must also enable the Password Utilities feature in your `server.xml`file: +You must also enable the Password Utilities feature in your `server.xml` file: [source, xml] ---- passwordUtilities-1.0 @@ -127,7 +127,7 @@ cloudant.dbname=testdb Instead of using `BasicAuthentication` with a username and password, Cloudant also supports `IAM (Identity and Access Management)` authentication, which allows users and applications to authenticate using secure API keys or IAM tokens. By using IAM authentication, we can avoid the risks associated with managing passwords and ensure that only authorized entities can interact with Cloudant databases. Follow the https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant[IBM Cloudant Setup] guide to create a Cloudant instance and API key for accessing it. -The code snippet below shows how can we create a CDI Producer to inject a Cloudant client with IAM authentication. +The following code snippet shows how can we create a CDI Producer to inject a Cloudant client with IAM authentication. [source, java] ---- @ApplicationScoped @@ -156,7 +156,7 @@ public class CloudantProducer { ---- == Injecting the Cloudant client -Here is an example of using the CDI producer to inject a Cloudant client in a JAX-RS application. +Here is an example of using the CDI producer to inject a Cloudant client in a JAX-RS application. [source, java] ---- @Inject @@ -170,7 +170,7 @@ String dbname; @Path("/add") @Consumes(MediaType.APPLICATION_JSON) public void add(CrewMember crewMember) { - Document newCrewMember = new Document(); + Document newCrewMember = new Document(); newCrewMember.put("Name",crewMember.getName()); newCrewMember.put("Rank",crewMember.getRank()); newCrewMember.put("CrewID",crewMember.getCrewID()); @@ -187,7 +187,7 @@ public void add(CrewMember crewMember) { } ---- -In the above code: +In this example: * `@Inject` is used to inject the Cloudant client instance provided by the CDI producer. * The `PostDocumentOptions` is a builder class that allows you to specify various options when posting the document. You must provide the db name and the document content. @@ -213,10 +213,10 @@ public String remove(@PathParam("id") String id) { DeleteDocumentOptions deleteDocumentOptions = new DeleteDocumentOptions.Builder() .db(dbname) - .docId(id) + .docId(id) .rev(document.getRev()) .build(); - + DocumentResult deleteDocumentResponse = client .deleteDocument(deleteDocumentOptions) .execute() @@ -228,11 +228,6 @@ In the previous example: * The `GetDocumentOptions` class is used to configure parameters for retrieving a document from a Cloudant database. It allows you to specify the database name, document ID, and optional parameters like the document revision, whether to include attachments, conflicts, or deleted information in the response. The class uses the builder pattern to set these options before making the request to Cloudant. * The `DeleteDocumentOptions` class is used to configure parameters for deleting a document from a Cloudant database. It allows you to specify the database name, the document ID, and the revision (`_rev`) of the document to ensure that the correct version is deleted and prevent race conditions. This class uses the builder pattern to set options before sending the delete request to Cloudant. -== No need for a Cloudant feature -Previously, integrating Cloudant into your application required enabling the `cloudant-1.0` feature in the `server.xml` file. The CDI producer now automates the integration process, allowing you to inject Cloudant resources directly into your application without needing to explicitly enable the `cloudant-1.0` feature. What makes this approach even more flexible is that, even if the Cloudant SDK for Java’s API undergoes changes in the future, you won’t need to make extensive updates to your application code, meaning that simple updates to the producer itself will be sufficient to ensure continued compatibility with newer versions of the SDK. - -As a result, when migrating to the new Cloudant SDK for Java, it is recommended that you remove the `cloudant-1.0` feature from your server.xml file. This not only streamlines your configuration but also aligns with the new, simplified approach of using the Cloudant CDI producer for integration. - == Summary In this blog post, we explored how easy it is to create a CDI producer for Cloudant, and configure it with MicroProfile Config to help integrate Cloudant into an Open Liberty-based Java application, leveraging the power of Cloudant's NoSQL database with the flexibility of Open Liberty’s lightweight, cloud-native architecture. The full sample is available link:https://github.com/OpenLiberty/sample-cloudant[on GitHub]. From 8655f29c77e29b0003876d0bed8961b9662289d2 Mon Sep 17 00:00:00 2001 From: David Mueller Date: Fri, 6 Dec 2024 11:56:43 -0500 Subject: [PATCH 26/28] add cloudant tags #4152 --- blog_tags.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blog_tags.json b/blog_tags.json index 7a6de887c..88f60fc1b 100644 --- a/blog_tags.json +++ b/blog_tags.json @@ -86,7 +86,8 @@ "featured": "true" },{ "name": "microprofile", - "posts": ["microprofile-7", "24.0.0.12", + "posts": ["cloudant-with-open-liberty", + "microprofile-7", "24.0.0.12", "24.0.0.10", "24.0.0.9", "rethinking-microservices", "24.0.0.9-beta", "liberty-on-amazon-ecs", "24.0.0.8-beta", @@ -591,7 +592,7 @@ }, { "name": "data-sources", - "posts": ["24.0.0.8-beta", + "posts": ["cloudant-with-open-liberty", "24.0.0.8-beta", "24.0.0.6-beta", "simplifying-nosql-database-integration-with-jakarta-nosql", "jakarta-nosql-in-action-meet-jnopo-game", "jakarta-nosql-challenge-switching-nosql-easily", "24.0.0.5-beta", "24.0.0.4-beta", From a1cb9cd8158fae6f7aaeed7c34584d1f08a9f5d0 Mon Sep 17 00:00:00 2001 From: David Mueller Date: Fri, 6 Dec 2024 12:56:15 -0500 Subject: [PATCH 27/28] Update 2024-12-9-cloudant-with-open-liberty.adoc --- posts/2024-12-9-cloudant-with-open-liberty.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posts/2024-12-9-cloudant-with-open-liberty.adoc b/posts/2024-12-9-cloudant-with-open-liberty.adoc index 95eb0e741..93a444b9f 100755 --- a/posts/2024-12-9-cloudant-with-open-liberty.adoc +++ b/posts/2024-12-9-cloudant-with-open-liberty.adoc @@ -1,16 +1,16 @@ --- layout: post -title: "Access Cloudant with Open Liberty using CDI" +title: "Access a Cloudant NoSQL database with Open Liberty using CDI" categories: blog author_picture: https://avatars3.githubusercontent.com/revijay author_github: https://github.com/revijay -seo-title: Access Cloudant with Open Liberty using CDI - OpenLiberty.io +seo-title: Access a Cloudant NoSQL database with Open Liberty using CDI - OpenLiberty.io seo-description: Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. blog_description: "Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java." open-graph-image: https://openliberty.io/img/twitter_card.jpg open-graph-image-alt: Open Liberty Logo --- -= Access Cloudant client with Open Liberty using CDI += Access a Cloudant NoSQL database with Open Liberty using CDI Reshmi Vijayan :imagesdir: / :url-prefix: From 3f760dbb1ea77881651a4b449ec8c904734c37ee Mon Sep 17 00:00:00 2001 From: David Mueller Date: Mon, 9 Dec 2024 09:38:01 -0500 Subject: [PATCH 28/28] Update 2024-12-9-cloudant-with-open-liberty.adoc --- posts/2024-12-9-cloudant-with-open-liberty.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posts/2024-12-9-cloudant-with-open-liberty.adoc b/posts/2024-12-9-cloudant-with-open-liberty.adoc index 93a444b9f..b266050c0 100755 --- a/posts/2024-12-9-cloudant-with-open-liberty.adoc +++ b/posts/2024-12-9-cloudant-with-open-liberty.adoc @@ -1,16 +1,16 @@ --- layout: post -title: "Access a Cloudant NoSQL database with Open Liberty using CDI" +title: "Access IBM Cloudant with Open Liberty using CDI" categories: blog author_picture: https://avatars3.githubusercontent.com/revijay author_github: https://github.com/revijay -seo-title: Access a Cloudant NoSQL database with Open Liberty using CDI - OpenLiberty.io +seo-title: Access IBM Cloudant NoSQL database with Open Liberty using CDI - OpenLiberty.io seo-description: Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java. blog_description: "Using Cloudant with Open Liberty previously meant enabling the cloudant-1.0 feature and configuring several elements in server.xml. With CDI and MicroProfile Config, you can easily configure access to Cloudant with a CDI producer. The cloudant-1.0 feature was implemented using Java Cloudant Client library which is no longer supported, so in this demonstration we are using the new Cloudant SDK for Java." open-graph-image: https://openliberty.io/img/twitter_card.jpg open-graph-image-alt: Open Liberty Logo --- -= Access a Cloudant NoSQL database with Open Liberty using CDI += Access IBM Cloudant with Open Liberty using CDI Reshmi Vijayan :imagesdir: / :url-prefix: