ノート:
- このチュートリアルでは、Oracle Cloudへのアクセスが必要です。無料アカウントにサインアップするには、Oracle Cloud Infrastructure Free Tierの開始を参照してください。
- Oracle Cloud Infrastructureの資格証明、テナンシおよびコンパートメントの値の例を使用します。演習を完了するときに、これらの値をクラウド環境に固有の値に置き換えます。
OKEでのSpring Bootを使用したOracle GraalVMベースのJavaアプリケーションの作成によるSOAPメッセージのATPへの格納およびOCIキューへの送信
イントロダクション
お客様の多くは、アプリケーション間の通信を可能にするために、従来のSimple Object Access Protocol(SOAP)メッセージングを利用しています。多くの場合、トランザクション・データの格納、サービスの分離の確保、受信リクエストのロード・バランシングの実現、およびこれらのメッセージの非同期通信の有効化が必要です。
このチュートリアルでは、Oracle Cloud Infrastructure Kubernetes Engine (OKE)インフラストラクチャにデプロイされたSpring Bootを使用して、Oracle GraalVMベースのJavaアプリケーションを構築する方法を説明します。このアプリケーションは、Oracle Autonomous Transaction Processing (ATP)やOCI Queueなどの様々なOracle Cloud Infrastructure (OCI)サービスを持つトランザクション・インテグレータとして使用されます。この設定により、システムは直接接続なしで対話できるため、処理速度が異なるアプリケーション間の通信が容易になります。また、情報がデータベースに格納されると、参照または分析できます。
以下の技術を使用します。
Oracle Cloud Infrastructure Services(OCI): OCIは、150以上のクラウド・サービスを提供する、安全で高パフォーマンスのクラウド・プラットフォームです。スケーラビリティ、セキュリティおよびパフォーマンスのために設計されています。
-
Oracle Cloud Infrastructure Kubernetes Engine(OKE): OKEは、OCIでコンテナ化されたアプリケーションをデプロイ、管理およびスケーリングするためのマネージド・サービスです。プロビジョニング、スケーリング、監視などのタスクを自動化し、堅牢なセキュリティとOCIの統合を確保します。OKEは、ステートレス・ワークロードとステートフル・ワークロードの両方をサポートし、最新のアプリケーション開発のための柔軟なプラットフォームを提供します。
-
OCI Container Registry Classic: OCIのマネージドDocker互換レジストリで、ユーザーはコンテナ・イメージを安全に保管、管理およびデプロイできます。OKEやその他のOCIサービスとシームレスに統合することで、コンテナ化されたアプリケーションを効率的に導入できます。
-
Oracle Autonomous Transaction Processing (ATP): ATPは、プロビジョニング、パッチ適用、スケーリング、バックアップなどのタスクを自動化し、高可用性とセキュリティを確保するクラウド・データベース・サービスです。トランザクション指向のワークロードに強力なパフォーマンスを提供し、自律的な運用とパフォーマンスの最適化のための機械学習を活用します。ATPは、アプリケーション開発、生成AI、完全なデータ保護、セキュリティなどの機能を利用して、常に高いパフォーマンスと最大限の可用性を確保します。
-
OCIキュー:分散アプリケーション間の非同期で分離された通信を可能にする、フルマネージドのサーバーレス・メッセージ・キュー・サービスです。自動スケーリング、メッセージの永続化、公正な処理などの機能により、信頼性の高いメッセージ配信を実現します。OCI Queueは、他のOCIサービスと統合され、業界標準のプロトコルをサポートしており、スケーラブルなイベントドリブン・アーキテクチャに最適です。
Oracleテクノロジ:
- Oracle GraalVM Java、JavaScript、Pythonなどの複数のプログラミング言語をサポートする高パフォーマンスの多言語仮想マシン(VM)です。ジャスト・イン・タイム(JIT)およびアヘッド・オブ・タイム(AOT)のコンパイルによりパフォーマンスが向上し、起動が高速になり、リソース使用量が削減されます。Oracle GraalVMは、最適化とプロファイリングのためのツールも提供しており、マイクロサービスやクラウドネイティブ・アプリケーションに最適です。
その他のテクノロジ:
- Spring Boot:自動構成および埋込みWebサーバーによるスタンドアロンの本番対応アプリケーションの作成を簡素化するJavaフレームワークです。ヘルス・チェックやメトリックなどの組込み機能を提供し、マイクロサービスおよびスケーラブル・アプリケーションの迅速な構築に最適です。
OCIハイ・レベル・アーキテクチャ:
ノート:
- JMeterは、顧客アプリケーションによって生成されるSOAPメッセージをシミュレートすることを明確にすることが重要です。
- このチュートリアルは、教育を目的としており、学生に実用的な経験を探求し、得るために制御された環境を提供します。示されているセキュリティ構成および演習は学習用に設計されており、本番環境や実際のアプリケーションには適していない場合があります。
目的
-
Spring Bootフレームワークを使用してOracle GraalVMベースのJavaアプリケーションを構築し、トランザクション・メッセージをATPに格納してOCIキューに送信するために必要なOCIサービス全体をプロビジョニングします。
-
OKEクラスタをプロビジョニングおよび構成します。
-
OCI Container Registry Classicのプロビジョニング、構成およびアクセス。
-
ATPサーバーレス・データベースをプロビジョニングおよび構成します。
-
ATPでプロジェクト表を接続して作成します。
-
OCI Queueのプロビジョニングおよび構成
-
Spring Bootを使用してOracle GraalVMベースのJavaアプリケーションを構築し、OKEにデプロイします。
-
JMeterを使用してSpring Boot Oracle GraalVMアプリケーションをテストします。
-
前提条件
-
OCI環境:このチュートリアルでは、アプリケーションを効果的にデプロイ、管理およびスケーリングするために必要なクラウド・インフラストラクチャ、サービスおよびセキュリティ構成を提供します。
-
OCIテナントへのアクセス。無料のOracle Cloudアカウントを作成するには、無料Oracle Cloudアカウントの作成を参照してください。
-
パブリック・サブネットとプライベート・サブネットを含むVCNを作成します。詳細は、VCNの作成およびサブネットの作成を参照してください。
-
OCIサービスをグループ化できるコンパートメントを作成します。詳細は、コンパートメントの作成を参照してください。
-
-
管理ホスト:管理ホスト(このチュートリアルでは、Oracle Linux 8を使用)を上位レベルのアーキテクチャで示すことが重要です。OKEクラスタおよびOCI Container Registry Classicを監視、可視化および制御するには、管理ホストをOCI CLI、kubectlおよびDockerで構成する必要があります。
-
プロビジョニング管理ホスト。詳細は、インスタンスの作成を参照してください。
-
Oracle Cloud Infrastructureコマンドライン・インタフェース(OCI CLI)をインストールします。詳細は、OCI CLIのインストールを参照してください。
-
Oracle Linux 8/7にDockerをインストールします。詳細は、Dockerのインストールを参照してください。
-
Linuxにkubectlをインストールして設定します。詳細は、kubectlのインストールを参照してください。
-
-
開発環境:コードを記述、テストおよびデバッグするには、開発環境が必要です。Apache MavenおよびOracle GraalVMをインストールします。
-
Oracle GraalVMをインストールします。詳細は、「Oracle GraalVMスタート・ガイド」を参照してください。
-
Apache Mavenをダウンロードしてインストールします。詳細は、MavenのダウンロードおよびMavenのインストールを参照してください。
-
Spring Bootアプリケーションを開発します。詳細は、最初のSpring Bootアプリケーションの開発およびSpringクイックスタート・ガイドを参照してください。
-
タスク1: OKEクラスタのプロビジョニングおよび構成
このタスクでは、Kubernetesプラットフォームをプロビジョニングします。このプラットフォームでは、ATPに格納するすべてのSOAP高トランザクション・メッセージをサポートし、それぞれをリアルタイムでOCIキューに送信します。
-
OCIコンソールにログインし、「開発者サービス」、「Kubernetesクラスタ(OKE)」に移動して、プリファレンスの「コンパートメント」を選択します。
OKEクラスタを作成する方法は2つあります。
- クイック作成。
- Custom Create.
-
「クイック作成」を選択します。この方法は、OKEが操作に必要なすべての要素を次のように簡単かつ高速に、自動的にデプロイするためです。
- 仮想クラウド・ネットワーク(VCN)
- インターネット・ゲートウェイ
- NAT (Network Address Translation)ゲートウェイ。
- サービス・ゲートウェイ
- Kubernetesクラスタ
- Kubernetesワーカー・ノードおよびノード・プール
ノート:すでに顧客がサービス、ネットワーク、インフラストラクチャを所有しているエンタープライズ環境では、OKEデプロイメントをコンプライアンスに準拠するようにカスタマイズし、クライアントのアーキテクチャ、リソースおよびベスト・プラクティスに従ってカスタマイズすることが重要です。
-
「クラスタの作成」をクリックし、次の情報を入力します。
- 名前: OKEクラスタの名前を入力します。
- コンパートメント:このプロジェクト用に作成されたコンパートメントを選択します。
- Kubernetesバージョン:使用可能な最新のKubernetesバージョンを選択します。
- Kubernetes APIエンドポイント:このチュートリアルでは、「パブリック・エンドポイント」を選択しますが、「プライベート・エンドポイント」を選択することもできます。
- ノード・タイプ: 「管理対象」ノードを選択します。
- Kubernetesワーカー・ノード: 「プライベート・ワーカー」を選択します。
- シェイプおよびイメージ: VM.Standard.E5を選択します。フレックスでは、OCPUの数(2)およびメモリー(16GB)をカスタマイズし、デフォルトのOracle Linux 8イメージを保存します。
- ノード数: OKEノード・プールとともにデプロイするワーカー・ノードを2つ入力します。
OKEクラスタが動作していることを確認します。
タスク2: OCI Container Registry Classicのプロビジョニング、構成およびアクセス
リポジトリ内のプロジェクト・イメージを管理する必要があります。これを実現するために、OCI Container Registry Classicをプロビジョニングします。イメージがOCI Container Registry Classicに格納されると、OKEにデプロイできるようになります。
-
OCIコンソールに移動し、「開発者サービス」、「コンテナおよびアーティファクト」、「コンテナ・レジストリ」に移動して、「リポジトリの作成」をクリックします。
-
次の情報を入力し、「Create」をクリックします。
- コンパートメントに作成:このプロジェクト用に作成されたコンパートメントを選択します。
- アクセス: 「パブリック」を選択します。
- リポジトリ名:
springboot/tutorialapp
と入力します。
-
リポジトリが作成されたら、Oracle管理ホストから次のコマンドを使用してアクセスします。
docker login -u 'tenancy_namespace/domain/username' regionID.ocir.io
Password: xxxxxx
タスク3: Oracle Autonomous Transaction Processing (ATP)サーバーレス・データベースのプロビジョニングおよび構成
ATPデータベースでは、トランザクションごとに受信した各SOAPメッセージのデータを格納します。およそ各メッセージの順序はミリ秒で、パラレル挿入と順次挿入が行われます。
-
OCIコンソールに移動し、「Oracle Database」に移動して「Autonomous Transaction Processing」をクリックします。
-
「Autonomous Databaseの作成」をクリックし、次の情報を入力します。
- コンパートメントの選択:このプロジェクト用に作成されたコンパートメントを選択します。
- 表示名: 表示名を入力します。
- データベース名の表示:データベース名を入力します。
- ワークロード・タイプの選択: 「トランザクション処理」を選択します。
- デプロイメント・タイプの選択: 「サーバーレス」を選択します。
- データベースを構成します:
- 開発者:選択を解除します。
- データベース・バージョンの選択: 「23ai」を選択します。
- ECPU数: 2と入力します。
- コンピュート自動スケーリング:選択してください。
- ストレージ: 1024GBと入力します。
- 自動バックアップ保持期間(日数):デフォルト・オプションは60日のままにします。
- 管理者資格証明を作成します:
- ユーザー名:デフォルトでは
ADMIN
であり、編集できません。 - パスワード:優先パスワードを入力します。
- パスワードの確認: パスワードを再度入力します。
- ユーザー名:デフォルトでは
- ネットワーク・アクセスの選択: 「プライベート・エンドポイント・アクセスのみ」を選択し、このプロジェクト用に作成されたVCNおよびサブネットを選択します。この設定により、指定したプライベート・ネットワーク(VCN)への接続のみが制限されます。ただし、他のオプションを選択することもできますが、これは会社のニーズによって異なります。
ATPデータベースが実行中であることを確認します。
タスク4: Oracle Autonomous Transaction Processing (ATP)でのプロジェクト表の接続および作成
ここでは、タスク3で生成されたATPデータベースにプロジェクト表を構成、接続および作成する必要があります。
-
OCIコンソールに移動し、「Oracle Database」→「Autonomous Transaction Processing」に移動し、「データベース接続」をクリックします。「TLS認証」、「TLS」を選択し、「Walletのダウンロード」をクリックします。
-
ウォレットの
.zip
ファイルを解凍し、tnsnames.ora
でデータソースURLを取得して、このデータベースへの接続を取得できます。このデータソースURLを保存します。たとえば次のようにします。
tutorialoracleatp_medium = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=xxxxxxxx.adb.sa-saopaulo-1.oraclecloud.com))(connect_data=(service_name=xxxxxxxxxxxxxxx_tutorialoracleatp_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
-
データベースへのアクセスが必要になりました。ATPがプロビジョニングされると、Oracle REST Data Services (ORDS)アクセスが有効になりました。詳細は、Oracle REST Data Servicesを参照してください。
「Autonomous Databaseの詳細」ページに移動し、「データベース・アクション」をクリックします。アクセスできるのは、同じ仮想クラウド・ネットワーク(VCN)で実行されているコンピュート・インスタンスからのみです。
-
ブラウザにURLを貼り付け、以前にATPデータベースに入力したユーザーおよびパスワードを使用してORDSにアクセスし、Oracle SQL Developer Webモジュールにアクセスします。
-
次の問合せを使用して、受信するSOAPメッセージに関連する表
USERS
、CARS
およびHOUSES
を作成します。CREATE TABLE USERS ( username varchar(50) NOT NULL, userlastname varchar(50) NOT NULL, id int NOT NULL, email varchar(50) NOT NULL, dateuser varchar(50) NOT NULL, attributeuser varchar(50) NOT NULL ); CREATE TABLE CARS ( userid int NOT NULL, brand varchar(50) NOT NULL, color varchar(50) NOT NULL, plate varchar(50) NOT NULL ); CREATE TABLE HOUSES ( userid int NOT NULL, floors int NOT NULL, locationhouse varchar(50) NOT NULL, rooms int NOT NULL, bathrooms int NOT NULL );
タスク5: OCIキューのプロビジョニングおよび構成
OCI Queueでは、特定の期間、RESTful HTTP APIを介して高度にトランザクション・メッセージを格納します。コンシューマは、メッセージを即時に、または都合のよいときに読み取って削除し、データの損失を防ぎます。
-
OCIコンソールに移動し、「開発者サービス」→「アプリケーション統合」に移動し、「キュー」をクリックします。
-
「キューの作成」をクリックし、次の情報を入力して「キューの作成」をクリックします。
- 名前:キューに適切な名前を入力します。
- コンパートメント:作業コンパートメントを選択します。
- キュー設定:このチュートリアルでは、「デフォルト構成」を選択しますが、必要に応じて、「表示タイムアウト」、「最大保持期間」、「最大チャネル消費」および「デッド・レター・キュー」設定などのビジネス・ニーズに応じて複数のオプションをカスタマイズできます。
- 暗号化設定の構成: 「Oracle管理キー」を選択しますが、「顧客管理キー」もオプションです。
OCIキューが実行中であることを確認します。
タスク6: Spring Bootを使用したOracle GraalVMベースのJavaアプリケーションのビルドおよびOKEへのデプロイ
ここでは、次のタスクを実行するOracle GraalVMベースのJavaアプリケーションをSpring Bootで開発およびデプロイします:
-
各HTTP Postリクエストで受信したXML SOAPメッセージからデータを取得します。
-
XML SOAPメッセージから抽出されたデータをATPのトランザクションごとに挿入します。
-
SOAP XML形式からJSON形式に変換します。
-
変換された各メッセージをOCIキューに配置します。
ノート:開始する前に、「前提条件- 管理ホスト」および「前提条件- 開発環境」の項に示すように、管理ホストおよび開発環境を作成することが重要です。
管理ホストおよび開発環境が構成され、準備が整ったら、Spring Bootプロジェクトの開発を開始できます。
-
Spring initializrに移動して、Spring Bootプロジェクトのフォルダ構造およびベース・ファイルを提供する最初のプロジェクトを作成し、後で要件に従って変更します。次の情報を入力して「生成」をクリックすると、Spring Bootプロジェクトが自動的にダウンロードされ、開発ホストに保存および解凍されます。
- プロジェクト: 「Maven」を選択します。
- 言語: 「Java」を選択します。
- Spring boot: 3.3.6を選択します。
- プロジェクト・メタデータ:
- グループ:
com.tutorial_springboot
と入力します。 - アーティファクト: tutorialと入力します。
- 名前: tutorialと入力します。
- 説明: Spring Boot Application (読取りSOAP、JSONへの変換、ATPの挿入およびOCIキューへの配置)と入力します。
- グループ:
- パッケージ化: 「Jar」を選択します。
- Java: 「17」を選択します。
- 依存性: 「Oracleドライバ」、「Spring Webサービス」および「Spring Web」を選択します。
ノート:プロジェクトにいくつかの依存関係を追加し、後で必要に応じて
pom.xml
ファイルに直接追加できます。 -
春のブーツ構造プロジェクトです。
pom.xml
ファイルを確認して、作業を開始します。このチュートリアルで提案されているスコープに従って、pom.xmlファイルを更新します。
-
oci sdk
バージョンおよび次の依存関係を追加します。oci-java-sdk-common
.oci-java-sdk-queue
.oci-java-sdk-addons-oke-workload-identity
.oci-java-sdk-common-httpclient-jersey3
.
アプリケーションは、OCIで認証し、OCI QueueなどのOCIサービスを接続および管理する必要があります。
-
すでに
pom.xml
ファイルにはspring-boot-starter-web-services
依存性があり、wsdl4j
依存性を追加する必要があります。主な目的は、SOAPメッセージから受信したデータを取得し、Javaオブジェクトに格納し、XMLペイロードを操作するSpring Webサービスを作成し、契約優先SOAPサービス開発を促進することです。また、ポート、URIを構成し、XMLスキーマ定義(XSD)ファイルからロードされたXMLスキーマを設定することもできます。 -
JSON依存関係を追加します。このライブラリは、SOAPメッセージから抽出されたデータを使用してJSON形式を生成するために使用されます。
-
「ビルド」セクションで
spring-boot-maven-plugin
プラグインを追加します。このプラグインにより、jar実行可能ファイルのSpring Bootプロジェクト・ファイルを生成できます。 -
「ビルド」セクションで
jaxb2-maven-plugin
プラグインを追加します。このプラグインは、Java API for XMLバインディング(JAXB)を使用してXMLスキーマからJavaクラスを生成し、このようにして、SOAPメッセージから作成されたJavaクラス・オブジェクトにデータを渡すことができます。このプラグイン・セクションでは、パスを示す構成(Spring Bootプロジェクトに含まれるXSDファイル)を配置することが重要です。
<configuration> <sources> <source>${project.basedir}/src/main/resources/messages.xsd<source> </sources> </configuration>
-
「依存性」セクションに
jasypt-spring-boot-starter
依存性を追加し、「ビルド」セクションのjasypt-maven-plugin
プラグインを追加して、application.properties
ファイル内の機密パラメータを暗号化し、アプリケーション内でのセキュアな使用を保証します。
pom.xml
ファイルに追加された次の依存関係を確認します。 -
-
ライブラリをダウンロードし、次のコマンドを実行します。
-
開発環境で、次のコマンドを実行してプロジェクトにアクセスします。
cd tutorial
-
プロジェクトを消去し、前のビルドで生成されたすべてのファイルを削除します。
mvn clean
-
ローカルmavenリポジトリからアーティファクトをパージ(削除およびオプションで再解決)します。
mvn dependency:purge-local-repository
-
-
すでに依存関係と
pom.xml
ファイルがプロジェクト内に構成されており、クライアント側からのリクエストを表すSOAP XMLファイルと、Spring Bootプロジェクト側でのリクエストを解釈するXSDファイルを確認します。-
このSOAP XMLファイルには2つのメッセージがあり、次の図に示すように、個人情報と、リクエストごとに送信する2つの異なるクライアントからのその他の種類の属性が含まれます。
-
Spring Bootプロジェクト側では、Spring Webサービスによって自動的にWSDLとしてエクスポートされるWebサービス・ドメインを定義するためにXMLスキーマが必要です。次のイメージは、このチュートリアルに定義されている
messages.xsd
ファイルを示しています。messages.xsd:
-
messages.xsd
ファイルをSpring Bootプロジェクトのresourcesフォルダに保存します。
-
-
jarファイルにプロジェクト・ファイルをビルドおよびインストールします。次のコマンドを実行して、Spring Bootプロジェクト・フォルダにいることを確認します。
mvn install
ノート: mavenインストール・コマンドが実行されると、ターゲット・フォルダが自動的に生成され、それと同じ方法で、以前に作成したXSDファイルに従ったJavaクラスと、プロジェクトの実行可能ファイル
.jar
ファイルが生成されます。 -
これで、必要なJavaクラスをSpring Bootプロジェクトに追加できるようになりました。
WebServiceConfig.java Class:
このJavaクラスは、SOAP Webサービスを作成するために開発されました。- SOAPリクエストを処理するためのサーブレットを設定します。
- XMLスキーマに基づいてWSDL定義を生成します。
- SOAP Webサービスのアクセス・エンドポイントを定義します。
- クラスパスから
messages.xsd
スキーマ・ファイルを使用します。
//Imports import org.springframework.boot.web.servlet.ServletRegistrationBean; //import the ServletRegistrationBean class import org.springframework.context.ApplicationContext; //import the ApplicationContext class import org.springframework.context.annotation.Bean; //import the Bean class import org.springframework.context.annotation.Configuration; //import the Configuration class import org.springframework.core.io.ClassPathResource; //import the ClassPathResource class import org.springframework.ws.config.annotation.EnableWs; //import the EnableWs class import org.springframework.ws.config.annotation.WsConfigurerAdapter; //import the WsConfigurerAdapter class import org.springframework.ws.transport.http.MessageDispatcherServlet; //import the MessageDispatcherServlet class import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition; //import the DefaultWsdl11Definition class import org.springframework.xml.xsd.SimpleXsdSchema; //import the SimpleXsdSchema class import org.springframework.xml.xsd.XsdSchema; //import the XsdSchema class //Configuration class for the Web Service configuration @EnableWs //Enable the Web Service @Configuration //Define the class as a Configuration class public class WebServiceConfig extends WsConfigurerAdapter { //Create a ServletRegistrationBean object to register the MessageDispatcherServlet object with the application context @Bean public ServletRegistrationBean<MessageDispatcherServlet> messageDispatcherServlet(ApplicationContext applicationContext) { MessageDispatcherServlet servlet = new MessageDispatcherServlet(); //Create a MessageDispatcherServlet object servlet.setApplicationContext(applicationContext); //Set the application context for the MessageDispatcherServlet object servlet.setTransformWsdlLocations(true); //Set the transformWsdlLocations property to true return new ServletRegistrationBean<>(servlet, "/ws/*"); //Return a new ServletRegistrationBean object with the MessageDispatcherServlet object and the URL pattern } //Create a DefaultWsdl11Definition object to define the WSDL @Bean(name = "messages") public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema messagesSchema) { DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition(); //Create a DefaultWsdl11Definition object wsdl11Definition.setPortTypeName("MessagesPort"); //Set the port type name wsdl11Definition.setLocationUri("/ws"); //Set the location URI wsdl11Definition.setTargetNamespace("http://tutorial_example.com/ns0"); //Set the target namespace wsdl11Definition.setSchema(messagesSchema); //Set the schema return wsdl11Definition; //Return the DefaultWsdl11Definition object } //Create a XsdSchema object to define the schema @Bean public XsdSchema messagesSchema() { return new SimpleXsdSchema(new ClassPathResource("messages.xsd")); //Return a new SimpleXsdSchema object with the messages.xsd file } }
ノート: Webサービスをテストする場合は、次のように、Spring Bootプロジェクトを同じローカル開発環境のデスクトップで実行し、
curl
を使用してHTTPリクエストを送信できます。mvn spring-boot:run
プロジェクトが実行され、Webサービスが稼働したら、次のように
curl
を使用してローカルSOAP HTTPリクエストを実行します。curl --location 'http://localhost:8080/ws/'
また、Spring Bootプロジェクトで公開されたWebサービスから応答が得られます。
-
model
というフォルダを作成し、このフォルダに次のJavaクラスを追加します。ノート:これらのJavaクラス
Car
、House
およびUser
は、HTTP SOAPリクエストから抽出された各SOAPメッセージのデータに基づいて情報を取得します。-
Car.java class:
このJavaクラスは、各ユーザーにリンクされた属性を持つCarオブジェクトを表します。``` //Imports import org.springframework.stereotype.Component; // For component scanning import org.springframework.context.annotation.Scope; // For defining bean scope @Component // Marks a class as a Spring-managed component @Scope("prototype") //A new instance is created every time the bean is requested public class Car { //Attributes private String brand; private String color; private String plate; //"getter" and "setter" methods to get and set the information in each object public String getBrand(){ return brand; } public void setBrand(String brand){ this.brand = brand; } public String getColor(){ return color; } public void setColor(String color){ this.color = color; } public String getPlate(){ return plate; } public void setPlate(String plate){ this.plate = plate; } } ```
-
House.java class:
このJavaクラスは、各ユーザーにリンクされた属性を持つHouseオブジェクトを表します。//Imports import org.springframework.stereotype.Component; // For component scanning import org.springframework.context.annotation.Scope; // For defining bean scope @Component // Marks a class as a Spring-managed component @Scope("prototype") //A new instance is created every time the bean is requested public class House { //Attributes private int floors; private String location; private int rooms; private int bathrooms; //"getter" and "setter" methods to get and set the information in each object public int getFloors(){ return floors; } public void setFloors(int floors){ this.floors = floors; } public String getLocation(){ return location; } public void setLocation(String location){ this.location = location; } public int getRooms(){ return rooms; } public void setRooms(int rooms){ this.rooms = rooms; } public int getBathRooms(){ return bathrooms; } public void setBathRooms(int bathrooms){ this.bathrooms = bathrooms; } }
-
User.java class:
このJavaクラスは、属性を含むUserオブジェクトを表し、CarおよびHouseオブジェクトを含みます。//Imports import org.springframework.stereotype.Component; // For component scanning import org.springframework.context.annotation.Scope; // For defining bean scope @Component // Marks a class as a Spring-managed component @Scope("prototype") //A new instance is created every time the bean is requested public class User { //Attributes private String username; private String userlastname; private int id; private String email; private String date; private String attribute; private Car car; private House house; //"getter" and "setter" methods to get and set the information in each object public String getUserName(){ return username; } public void setUserName(String username){ this.username = username; } public String getUserLastName(){ return userlastname; } public void setUserLastName(String userlastname){ this.userlastname = userlastname; } public int getID(){ return id; } public void setID(int id){ this.id = id; } public String getEmail(){ return email; } public void setEmail(String email){ this.email = email; } public String getDate(){ return date; } public void setDate(String date){ this.date = date; } public String getAttribute(){ return attribute; } public void setAttribute(String attribute){ this.attribute = attribute; } public Car getCar(){ return car; } public void setCar(Car car){ this.car = car; } public House getHouse(){ return house; } public void setHouse(House house){ this.house = house; } }
-
-
-
ここでは、取得したデータをOCI ATPデータベースに格納するために必要なパラメータをSpring Bootプロジェクトで構成します。
resources
フォルダには、アプリケーションに必要なパラメータの追加に使用するapplication.properties
ファイルが必要です。これは自動的に生成され、アプリケーションの起動時にSpring Bootによってロードされます。ノート:パスワードや関連データなどの機密情報をハッカーが抽出または表示できないようにする暗号化およびセキュリティの方法を管理することは非常に重要です。このチュートリアルでは、
pom.xml
ファイルで構成されたjasypt
ライブラリを使用します。詳細は、「Jasyptを使用してSpring Bootプロジェクトでパスワードを暗号化する方法」を参照してください。また、Spring BootのJavaクラスでは、application.properties
パラメータを復号化するために、このライブラリに関連する注釈およびソース・コードを追加する場所について説明します。次の図に示すように、ATPデータベースに必要な適切なパラメータを
application.properties
ファイルに追加します。Spring Boot Javaクラスを作成して、各メッセージをデータベースに格納します。このクラスは、次の図に示すように
database
フォルダにあります。-
SoapObjectRepository.java:
このSpring Boot Javaクラスでは、JDBCドライバを使用して、ATPの各メッセージをリアルタイムのトランザクション形式で挿入できます。//Java Classes USER, CAR, HOUSE Imports import com.oracle_springboot_tutorial.tutorial.model.*; //Spring Boot Imports import org.springframework.stereotype.Repository; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.beans.factory.annotation.Autowired; //Repository Class to save SOAP Messages in the Database @Repository public class SoapObjectRepository { private JdbcTemplate template; private User user; //Getters and Setters for JdbcTemplate template object public JdbcTemplate getTemplate(){ return template; } //Autowired annotation to inject JdbcTemplate object into the template object @Autowired public void setTemplate(JdbcTemplate template){ this.template = template; } //Method to save User SOAP Message in the Database public void saveUserSOAPMessage(User user){ this.user = user; String sql = "INSERT INTO USERS (username, userlastname, id, email, dateuser, attributeuser) VALUES(?, ?, ?, ?, ?, ?)"; template.update(sql, user.getUserName(), user.getUserLastName(), user.getID(), user.getEmail(), user.getDate(), user.getAttribute()); } //Method to save Car SOAP Message in the Database public void saveCarSOAPMessage(Car car){ String sql = "INSERT INTO CARS (userid, brand, color, plate) VALUES(?, ?, ?, ?)"; template.update(sql, user.getID(), car.getBrand(), car.getColor(), car.getPlate()); } //Method to save House SOAP Message in the Database public void saveHouseSOAPMessage(House house){ String sql = "INSERT INTO HOUSES (userid, floors, locationhouse, rooms, bathrooms) VALUES(?, ?, ?, ?, ?)"; template.update(sql, user.getID(), house.getFloors(), house.getLocation(), house.getRooms(), house.getBathRooms()); } }
次に、JSONソフトウェア・コードを追加し、次の図に示すように、最初に
json_message
フォルダとそのJava Spring Bootクラスを作成します。 -
JsonBuilder.java:
このSpring Boot Javaクラスは、SOAP XML形式からJSON形式に変換します。//Imports to be used for JSON import org.json.JSONArray; import org.json.JSONObject; //Imports to be used for the User class import com.oracle_springboot_tutorial.tutorial.model.*; //Imports to be used for the ArrayList class import java.util.ArrayList; public class JsonBuilder { //The buildJsonMessage method creates a JSON object from the ArrayList of User objects public JSONObject buildJsonMessage(ArrayList<User> usersMessageArray) { JSONObject rootJson = new JSONObject(); //Create a new JSON object called rootJson JSONObject messagesJson = new JSONObject(); //Create a new JSON object called messagesJson JSONArray messageArray = new JSONArray(); //Create a new JSON array called messageArray //Iterate through the ArrayList of User objects and create a JSON object for each User object in the ArrayList for (User user : usersMessageArray) { JSONObject messageJson = new JSONObject(); messageJson.put("username", user.getUserName()); //Add the username of the user to the messageJson object messageJson.put("userlastname", user.getUserLastName()); //Add the userlastname of the user to the messageJson object messageJson.put("id", user.getID()); //Add the id of the user to the messageJson object messageJson.put("email", user.getEmail()); //Add the email of the user to the messageJson object messageJson.put("date", user.getDate()); //Add the date of the user to the messageJson object messageJson.put("attribute", user.getAttribute()); //Add the attribute of the user to the messageJson object // JSONObject bodyJson = new JSONObject(); //Create a new JSON object called bodyJson JSONObject envelopeJson = new JSONObject(); //Create a new JSON object called envelopeJson //Switch statement to check the attribute of the User object switch (user.getAttribute()) { case "CAR": Car car = user.getCar(); envelopeJson.put("brand", car.getBrand()); //Add the brand of the car to the envelopeJson object envelopeJson.put("color", car.getColor()); //Add the color of the car to the envelopeJson object envelopeJson.put("plate", car.getPlate()); //Add the plate of the car to the envelopeJson object break; case "HOUSE": House house = user.getHouse(); envelopeJson.put("floors", house.getFloors()); //Add the floors of the house to the envelopeJson object envelopeJson.put("location", house.getLocation()); //Add the location of the house to the envelopeJson object envelopeJson.put("rooms", house.getRooms()); //Add the rooms of the house to the envelopeJson object envelopeJson.put("bathrooms", house.getBathRooms()); //Add the bathrooms of the house to the envelopeJson object break; default: System.out.println("Unknown subject: " + user.getAttribute()); } bodyJson.put("envelope", envelopeJson); //Add the envelopeJson object to the bodyJson object messageJson.put("body", bodyJson); //Add the bodyJson object to the messageJson object messageArray.put(messageJson); //Add the messageJson object to the messageArray array } messagesJson.put("message", messageArray); //Add the messageArray array to the messagesJson object rootJson.put("messages", messagesJson); //Add the messagesJson object to the rootJson object return rootJson; } }
-
-
これで、JSON形式のメッセージをOCI Queueに送信できるようになりました。次の図に示すように、
oci_queue
フォルダとそのJava Spring Bootクラスを作成します。ノート:
OCIQueue.java
クラスでは、OKEからOCIキューへのアクセスを定義する必要があります。このチュートリアルでは、ワークロード・アクセスを使用して、テナンシに関連付けられたユーザー、パスワード、OCIDsなどの機密情報を処理することなく、OCIリソースへのアクセス権を付与します。詳細は、「ワークロードのOCIリソースへのアクセス権の付与」を参照してください。OCIQueue.java
クラスの開発を開始する前に、テナンシでワークロード・アクセスを構成します。まず、Oracle GraalVMベースのJavaアプリケーションに関連付けるネームスペースを作成する必要があります。管理ホストにいることを確認します。kubectl create ns-tutorial
次に、アプリケーションのKubernetesサービス・アカウントを作成します。
kubectl create serviceaccount tutorialserviceaccount --namespace ns-tutorial
ここで、OCI IAMポリシーを定義して、ワークロードが必要なOCIリソースにアクセスできるようにします。このチュートリアルでは、OCIキューです。
OCIコンソールに移動し、「アイデンティティとセキュリティ」、「ポリシー」に移動して、「ポリシーの作成」をクリックします。次の情報を入力し、「Create」をクリックします。
- 名前:優先ポリシー名を入力します。
- 説明: Access from oke to oci queueと入力します。
-
ポリシー・ビルダー:
Allow any-user to use queues in compartment id ocid1.compartment.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx where all {request.principal.type = 'workload', request.principal.namespace = 'ns-tutorial', request.principal.service_account = 'tutorialserviceaccount', request.principal.cluster_id = 'ocid1.cluster.oc1.sa-saopaulo-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
ワークロード・アクセス・ポリシー、ネームスペースおよびサービス・アカウントを構成したら、続行できます。
application.properties
ファイルで、タスク5で作成した特定のOCIキューの接続および管理に必要なキュー・パラメータを追加します。-
OCIQueue.java:
このSpring Boot Javaクラスでは、メッセージにアクセスしてOCIキューに配置できます。//Imports import com.oracle.bmc.auth.okeworkloadidentity.OkeWorkloadIdentityAuthenticationDetailsProvider; //Import OkeWorkloadIdentityAuthenticationDetailsProvider to enable access and use OCI Workload Identity import com.oracle.bmc.queue.QueueClient; //Import QueueClient to have access and manage of OCI Queue import com.oracle.bmc.queue.model.PutMessagesDetails; //Import PutMessagesDetails to send messages to the OCI Queue import com.oracle.bmc.queue.model.PutMessagesDetailsEntry; //Import PutMessagesDetailsEntry to send messages to the OCI Queue import com.oracle.bmc.queue.requests.PutMessagesRequest; //Import PutMessagesRequest to send messages to the OCI Queue //Imports for the ArrayList and List import java.util.ArrayList; import java.util.List; public class OCIQueue { //Set the required parameters to access to OCI and the Queue //Variables private String queueId; private String endPoint; private String region; //Constructor to initialize the OCI Queue object with the required parameters public OCIQueue(String queueId, String endPoint, String region){ this.queueId = queueId; this.endPoint = endPoint; this.region = region; } //The sendMessages method sends a message to the OCI Queue public void sendMessages(String jsonMessage){ try{ //Create an OkeWorkloadIdentityAuthenticationDetailsProvider object to authenticate the OCI Queue OkeWorkloadIdentityAuthenticationDetailsProvider provider = new OkeWorkloadIdentityAuthenticationDetailsProvider.OkeWorkloadIdentityAuthenticationDetailsProviderBuilder().build(); //Create a QueueClient object to send the message to the OCI Queue QueueClient queueClient = QueueClient.builder().build(provider); queueClient.setRegion(region); queueClient.setEndpoint(endPoint); //Create a PutMessagesDetailsEntry object to send the message PutMessagesDetailsEntry message = PutMessagesDetailsEntry.builder() .content(jsonMessage) .build(); //Create a List of PutMessagesDetailsEntry objects to send the message List<PutMessagesDetailsEntry> messages = new ArrayList<>(); messages.add(message); //Create a PutMessagesDetails object to send the message PutMessagesDetails putMessagesDetails = PutMessagesDetails.builder() .messages(messages) .build(); // Create a PutMessagesRequest object to send the message PutMessagesRequest putMessagesRequest = PutMessagesRequest.builder() .queueId(queueId) .putMessagesDetails(putMessagesDetails) .build(); // Send the request and get the response queueClient.putMessages(putMessagesRequest); }catch(Exception e){ System.out.println("Exception sending message to OCI Queue: "+e); } } }
-
データベース、JSONおよびOCI QueueのSpring Boot Javaクラスを取得したら、
MessagesEndpoint.java
クラスに進むことができます。このために、
endpoint
というフォルダとそのSpring Boot Javaクラスを作成します。ノート:
MessagesEndpoint.java
では、自動生成されたクラスをインポートする必要があります。これを行うには、pom.xml
ファイルの「構成」セクションに次のソースを追加します。<configuration> <sources> <source>${project.build.directory}/generated-sources</source> </sources> </configuration>
pom.xml
ファイルは次のようになります。-
MessagesEndpoint.java:
このSpring Boot Javaクラスの目的は、SOAP HTTPリクエストを抽出し、その値をメッセージごとにUser、CarおよびHouse Javaオブジェクトにマップすることです。次に、抽出されたデータをSOAP XMLトランザクションごとにATPデータベースに格納し、データをXMLからJSON形式に変換して、メッセージをOCIキューに配置します。これらのメッセージは、後でコンシューマによってキューから取得および削除できます。//Imports import com.oracle_springboot_tutorial.tutorial.model.*; //Import all the classes from the model package import com.oracle_springboot_tutorial.tutorial.oci_queue.OCIQueue; //Import the OCIQueue class from the oci_queue package import com.tutorial_example.ns0.Messages;//Import the Messages class from the tutorial_example.ns0 package (Auto generated Java Classes from the WSDL) import com.tutorial_example.ns0.MessageType; //Import the MessageType class from the tutorial_example.ns0 package (Auto generated Java Classes from the WSDL) //Import the ArrayList class from the java.util package import java.util.ArrayList; //Spring Boot imports to be used for the SOAP Web Service import org.springframework.beans.factory.annotation.Autowired; //Import the @Autowired annotation to inject the SoapObjectRepository object import org.springframework.beans.factory.annotation.Value; //Import the @Value annotation to inject the values from the application.properties file import org.springframework.stereotype.Component; //Import the @Component annotation to register the class with Spring //Spring Boot imports import org.springframework.ws.server.endpoint.annotation.Endpoint; //Import the @Endpoint annotation to register the class with Spring WS import org.springframework.ws.server.endpoint.annotation.PayloadRoot; //Import the @PayloadRoot annotation to specify the namespace URI and local part of the request payload import org.springframework.ws.server.endpoint.annotation.RequestPayload; //Import the @RequestPayload annotation to map the request payload to the method parameter import org.springframework.ws.server.endpoint.annotation.ResponsePayload; //Import the @ResponsePayload annotation to map the returned value to the response payload //Imports to be used storing SOAP information in the database import com.oracle_springboot_tutorial.tutorial.database.SoapObjectRepository; //Import the SoapObjectRepository class from the database package //Imports to be used for JSON import com.oracle_springboot_tutorial.tutorial.json_message.JsonBuilder; //Import the JsonBuilder class from the json_message package import org.json.JSONObject; //Import the JSONObject class from the org.json package //The @Endpoint annotation registers the class with Spring WS. //The @Component annotation registers the class with Spring to be used as a Spring Bean. @Endpoint @Component public class MessagesEndpoint { //Inject not encrypted and decrypted values using jasypt library from the application.properties file @Value("${oci.queue.queueId}") private String queueId; @Value("${oci.queue.endPoint}") private String endPoint; @Value("${oci.queue.region}") private String region; @Value("${spring.datasource.password}") private String datasourcePassword; //The @Autowired loads JDBC template in SoapObjectRepository. @Autowired private SoapObjectRepository soapObjectRepository = new SoapObjectRepository(); //Create a new instance of the JsonBuilder class JsonBuilder jsonBuilder = new JsonBuilder(); //The namespace URI private static final String NAMESPACE_URI = "http://tutorial_example.com/ns0"; //The handleMessagesRequest method is annotated with @PayloadRoot, which means that it is invoked when a request with the specified namespace URI and local part is received. @PayloadRoot(namespace = NAMESPACE_URI, localPart = "messages") //The @ResponsePayload annotation makes Spring WS map the returned value to the response payload. @ResponsePayload //The handleMessagesRequest method processes the request and sends the message to the OCI Queue. public void handleMessagesRequest(@RequestPayload Messages request) { OCIQueue ociQueue = new OCIQueue(queueId, endPoint, region); //Create an ArrayList to store the users ArrayList<User> usersMessageArray = new ArrayList<User>(); //Iterate over the messages, extracting the SOAP Messages and storing in the Java Objects (Car, House, User) for (MessageType message : request.getMessage()) { User user = new User(); user.setUserName(message.getUsername()); user.setUserLastName(message.getUserlastname()); user.setID(message.getId()); user.setEmail(message.getEmail()); user.setDate(message.getDate()); user.setAttribute(message.getAttribute()); //Insert User in Oracle ATP soapObjectRepository.saveUserSOAPMessage(user); //Process the attributes Car or House depending of the kind of User processMessage(user, message); //Add the user to the ArrayList usersMessageArray.add(user); } //Convert to JSON format JSONObject jsonObject = jsonBuilder.buildJsonMessage(usersMessageArray); //Send the JSON message to OCI Queue ociQueue.sendMessages(jsonObject.toString()); } //The processMessage method processes the message based on the user's attribute. private void processMessage(User user, MessageType message) { String subject = user.getAttribute(); switch (subject) { case "CAR": handleCAR(user, message); break; case "HOUSE": handleHouse(user, message); break; default: System.out.println("Unknown subject: " + subject); } } //The handleCAR method processes the CAR message. private void handleCAR(User user, MessageType message) { Car car = new Car(); car.setBrand(message.getBody().getEnvelope().getBrand()); car.setColor(message.getBody().getEnvelope().getColor()); car.setPlate(message.getBody().getEnvelope().getPlate()); user.setCar(car); //Insert Car in Oracle ATP soapObjectRepository.saveCarSOAPMessage(user.getCar()); } //The handleHouse method processes the HOUSE message. private void handleHouse(User user, MessageType message) { House house = new House(); house.setFloors(message.getBody().getEnvelope().getFloors()); house.setLocation(message.getBody().getEnvelope().getLocation()); house.setRooms(message.getBody().getEnvelope().getRooms()); house.setBathRooms(message.getBody().getEnvelope().getBathrooms()); user.setHouse(house); //Insert Houses in Oracle ATP soapObjectRepository.saveHouseSOAPMessage(user.getHouse()); } }
-
-
Spring Bootプロジェクトの構築が完了したので、プロジェクト・フォルダに
Dockerfile
を作成します。
-
Dockerfile
:FROM container-registry.oracle.com/graalvm/jdk:17 WORKDIR /app COPY target/*.jar app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app/app.jar"]
ノート: Dockerファイルの最初の行は、Oracleのコンテナ・レジストリからGraalVM JDKイメージをベース・イメージとしてプルおよび設定します。最初から、最適化された実行のためのJust-In-Time (JIT)コンパイルを活用して、高パフォーマンスのJDKを提供します。
-
次のコマンドを実行して、ローカルのDockerリポジトリでプロジェクト・イメージを構築およびプッシュします。
docker build . -t springbootapp:latest
-
次のコマンドを実行して、ローカルのDockerリポジトリでイメージを確認します。
docker images
-
Spring Bootアプリケーション・イメージにOCI Container Registry Classicリポジトリの完全なパスをタグ付けできます。
docker tag springbootapp:latest gru.ocir.io/xxxxxxxxxx/springboot/tutorialapp:latest
-
次のコマンドを実行して、ローカルのDockerリポジトリで確認します。
docker images
-
次のコマンドを実行して、イメージをOCI Container Registry Classicにプッシュします。
docker push gru.ocir.io/xxxxxxxxxx/springboot/tutorialapp:latest
-
OCI Container Registry ClassicでOKEイメージ・アプリケーションを確認するには、「開発者サービス」、「コンテナおよびアーティファクト」に移動し、「コンテナ・レジストリ」をクリックします。
イメージがOCI Container Registry Classicに入ると、開発環境に移動し、このイメージをOKEにデプロイできます。このチュートリアルでは、次のコマンドを実行して、必要な構成を作成します。
ノート:ネームスペースおよびサービス・アカウントは以前に構成されているため、シークレットが必要です。
-
次のコマンドを実行して、プロジェクト・フォルダにアクセスします。
cd tutorial/
-
次のコマンドを実行して、OKEのシークレットを作成します。
kubectl create secret -n ns-tutorial generic ocir --from-file=.dockerconfigjson=../.docker/config.json --type=kubernetes.io/dockerconfigjson
-
-
すでにOKE環境が用意されているため、OCI Container Registry ClassicからOKEにアプリケーション・イメージをデプロイします。
ノート:アプリケーション・イメージをデプロイするには、マニフェスト・ファイルが必要です。このチュートリアルでは、次の
yaml
ファイルがマニフェスト・ファイルであり、アプリケーションのデプロイと、80
ポートを使用してリスニングしているOCIロード・バランサで表されるイングレス・サービスの作成に使用されます。-
springboot_application.yaml
:apiVersion: apps/v1 kind: Deployment metadata: name: soap-oci-queue-app namespace: ns-tutorial labels: app: soap-oci-queue-app spec: replicas: 6 selector: matchLabels: app: soap-oci-queue-app template: metadata: labels: app: soap-oci-queue-app spec: serviceAccountName: tutorialserviceaccount automountServiceAccountToken: true containers: - name: soap-oci-queue-app image: gru.ocir.io/xxxxxxxxxxxx/springboot/tutorialapp:latest ports: - containerPort: 8080 imagePullSecrets: - name: ocir-docker-config --- apiVersion: v1 kind: Service metadata: name: svc-dev-app namespace: ns-tutorial spec: selector: app: soap-oci-queue-app ports: - port: 80 targetPort: 8080 type: LoadBalancer
-
-
マニフェスト・ファイルを保存したフォルダで
kubectl
コマンドを実行します。kubectl apply -f springboot_application.yaml
これで、アプリケーションがデプロイされ、イングレス・ロード・バランサ・サービスがOKEに作成されます。
-
OKEで作成されたポッドおよびサービスを検証するには、次のコマンドを実行します。
kubectl get pods -A
kubectl get svc -A
ノート: tutorial.zipからSpring Boot Oracle GraalVMベースのJavaアプリケーション・プロジェクトをダウンロードします。
タスク7: JMeterを使用したSpring Boot Oracle Graal VMアプリケーションのテスト
JMeterインストールの詳細は、JMeterのスタート・ガイドを参照してください。
JMeterがインストールおよび構成されると、HTTP POST SOAPリクエストを送信できます。たとえば、2つの同時ユーザーまたはアプリケーションを表すスレッド数を2に設定し、「ループ数」を3000に設定します。つまり、各ユーザーまたはアプリケーションが合計6000のSOAPリクエストに対して3000リクエストを送信します。
JMeterで、OCIロード・バランサIP、Spring Bootプロジェクトで構成されたパス、および本文にSOAP XMLを設定します。
6000 SOAPトランザクションでJMeterを実行し、確認します。
ノート:クライアント・アプリケーションのSOAPメッセージングをシミュレートしているため、SOAP HTTPリクエストごとに、情報は前述のSOAP XMLファイルに表示される情報と同じであり、変更されませんが、実際の顧客環境では情報は確実に異なります。
次の文を実行します。
-
ATPに保存されているデータの合計を表示します。
-
ATPの各表に格納されているデータの詳細を表示します。
-
CARS:
-
住宅:
-
ユーザー:
-
-
OCIキューに格納されているOCIキュー・リクエストの合計を確認します。
-
OCIキューのメッセージ詳細をJSON形式で表示します。
承認
- 著者 -IvánAlexanderVásquezChinome (Oracle LAD A-Team Cloudソリューション・スペシャリスト)
その他の学習リソース
docs.oracle.com/learnの他のラボを確認するか、Oracle Learning YouTubeチャネルで無料のラーニング・コンテンツにアクセスしてください。また、education.oracle.com/learning-explorerにアクセスしてOracle Learning Explorerになります。
製品ドキュメントについては、Oracle Help Centerを参照してください。
Create an Oracle GraalVM based Java Application using Spring Boot on OKE to Store SOAP Messages in ATP and Send to OCI Queue
G27172-01
February 2025
Copyright ©2025, Oracle and/or its affiliates.