このコンテンツは選択した言語では利用できません。

14.2. Use a RemoteInvoker


Procedure 14.1. Task

  • Include a RemoteInvoker and supporting classes in your application with the following Maven dependency:
    <dependency>
       <groupId>org.switchyard</groupId>
       <artifactId>switchyard-remote</artifactId>
       <version> <!-- SY version goes here (e.g. 1.0) --> </version>
    </dependency>
    
    Copy to Clipboard Toggle word wrap
Each instance of SwitchYard includes a special context path called switchyard-remote, which is bound to the default HTTP listener in Red Hat JBoss Fuse. The initial version of RemoteInvoker supports communication with this endpoint directly. Here is an example of invoking an in-out service in SwitchYard using the HttpInvoker:
public class MyClient {
    public static void main(String[] args) throws Exception {
        RemoteInvoker invoker = new HttpInvoker("http://localhost:8080/switchyard-remote");
        Offer offer = new Offer();
        offer.setAmount(100);
        offer.setItem("honda");
        
        RemoteMessage msg = invoker.invoke(new RemoteMessage()
            .setContext(new DefaultContext())
            .setService(new QName("urn:com.example.switchyard:remote", "Dealer"))
            .setContent(offer));
        
        Deal deal = (Deal)msg.getContent();
        System.out.println("It's a deal? " + deal.isAccepted());
    }
}
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat