データサービスのRESTエンドポイントURLでコンテキスト変数を使用 - Cloud - 8.0

ESB REST

Version
Cloud
8.0
Language
日本語
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
ジョブデザインと開発 > サードパーティーシステム > ESBコンポーネント > ESB RESTコンポーネント
データガバナンス > サードパーティーシステム > ESBコンポーネント > ESB RESTコンポーネント
データクオリティとプレパレーション > サードパーティーシステム > ESBコンポーネント > ESB RESTコンポーネント
Last publication date
2024-02-28

コンテキスト変数はRESTサービスプロバイダーでサポートされており、データサービスのコンシューマーエンドポイントで利用できます。これにより、エンドポイントをコンテキスト化しながら、複数の対話するサービスをTalend Studioでローカルに実行できるため、異なるコンテキストを使用してさまざまな環境にサービスをデプロイできます。

Talendでサポートされているテクノロジーの詳細は、Talendコンポーネントをご覧ください。

絶対パスか相対パスを使い、tRESTRequesttRESTClientcRESTのエンドポイントURLでコンテキスト変数を使用することができます。

たとえば、次のコンテキスト変数はTalend Studioで定義されています。

[Context] (コンテキスト)

context.full_a

http://localhost:8090/services/customers

context.full_b http://localhost:8090/customers
context.full_c http://localhost:8090/any/customers

context.url_a

/customers

context.url_b

/services/customers

context.port_a

8090

context.port_b

8091

コンテキスト変数を使用してエンドポイントURLを指定すると、サービスは次のアドレスで公開されます。

[Endpoint] (エンドポイント) Studio Runtime (ランタイム) マイクロサービス(app/docker)

context.full_a

http://localhost:8090/services/customers

http://localhost:8090/services/customers http://localhost:8090/services/customers
context.full_b http://localhost:8090/customers http://localhost:8090/customers http://localhost:8090/customers
context.full_c http://localhost:8090/any/customers http://localhost:8090/any/customers http://localhost:8090/any/customers

context.url_a

http://localhost:8090/customers http://localhost:8040/services/customers http://localhost:8065/services/customers

context.url_b

http://localhost:8090/services/customers http://localhost:8040/services/customers http://localhost:8065/services/customers
"http://localhost:"+ context.port_b + context.url_b http://localhost:8091/services/customers http://localhost:8091/services/customers http://localhost:8091/services/customers

context.url_a + "/rest"

http://localhost:8090/customers/rest http://localhost:8040/services/customers/rest http://localhost:8065/services/customers/rest

"http://localhost:8090" + context.url_a + "/" + System.getProperty("user.name")

http://localhost:8090/customers/<DynamicOSLoginUserName> http://localhost:8040/services/customers/<DynamicOSLoginUserName> http://localhost:8065/services/customers/<DynamicOSLoginUserName>
注: エンドポイントにSystem.getPropertyなどのJavaコードが含まれている場合、ユーザーは Talend Runtimeまたはマイクロサービスでバンドルを実行する前にこのプロパティを設定する必要があります。そうしないと、プロパティが欠落しているため、エラーが発生します。