![]() ![]() Save the credentials in an environment variables file in the directory for the producer component: $ rhoas service-account create -type env -output-file. $ cd app-services-guides/code-examples/quarkus-service-registry-quickstart/Ĭreate a service account for the Quarkus application to authenticate with the Kafka and Service Registry instances in the context. Now, clone a sample Quarkus application to run locally: $ git clone You could also add existing Kafka and Service Registry instances to the current context using the context set-kafka and context set-registry CLI commands. The new Kafka and Service Registry instances are automatically added to the current context. $ rhoas service-registry create -name example-registry-instance Next, create some Kafka and Service Registry instances in the current context: $ rhoas kafka create -name example-kafka-instance -wait ![]() ![]() You can create multiple contexts, putting different services in each one, and offering contexts to different developers to give them access to sets of services. The context you just created becomes the current context. The Quarkus application produces a stream of quotes (actually randomly generated strings of characters) and displays them on a web page.įirst, create a brand new service context: $ rhoas context create -name quotes-dev This example uses service contexts to connect an example Quarkus application to some Kafka and Service Registry instances in OpenShift application services. Connect a Quarkus application to OpenShift application services Then we'll look at how to use contexts with OpenShift-based applications and how to share contexts with other team members. This article shows where service contexts excel and why we are excited to introduce this feature.įirst, we will walk through a practical example that uses service contexts to connect a local client application to some instances in OpenShift application services. This process represents a significant improvement over time-consuming and error-prone workflows that require you to create individual configuration files for standalone service instances and applications in different languages. Thus, service contexts enable you to switch easily between defined sets of service instances and to quickly and reliably generate connection configurations for those instances. After you define a context, a single command can generate the connection configuration information required by client applications.įigure 1: A context represents a collection of services dedicated to a particular purpose. With the new service contexts feature, you can use the CLI to define sets of service instances for specific use cases, projects, or environments, as indicated in Figure 1. The CLI for OpenShift application services is a rich command-line interface for managing application services. Red Hat OpenShift application services, such as Red Hat OpenShift Streams for Apache Kafka and Red Hat OpenShift Service Registry, are managed cloud services that provide a streamlined developer experience for building, deploying, and scaling real-time applications in hybrid-cloud environments. Service contexts facilitate client connections This article illustrates this new feature and shows how it can accelerate your development workflows for stream-based applications. The latest release of rhoas, the command-line interface (CLI) for Red Hat OpenShift application services, adds a powerful and flexible feature called service contexts that makes it easier than ever to connect clients to your instances of OpenShift application services. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |