283.4. 使用

RMI レジストリーに登録されている既存の RMI サービスを呼び出すには、次のようなルートを作成します。

from("pojo:foo").to("rmi://localhost:1099/foo");

RMI レジストリー内の既存の camel プロセッサーまたはサービスを BIND するには、次のように RMI エンドポイントを定義します。

RmiEndpoint endpoint= (RmiEndpoint) endpoint("rmi://localhost:1099/bar");
endpoint.setRemoteInterfaces(ISay.class);
from(endpoint).to("pojo:bar");

RMI コンシューマーエンドポイントをバインドするときは、公開する Remote インターフェイスを指定する必要があることに注意してください。

XML DSL では、Camel 2.7 以降では次のようにできます。

    <camel:route>
        <from uri="rmi://localhost:37541/helloServiceBean?remoteInterfaces=org.apache.camel.example.osgi.HelloService"/>
        <to uri="bean:helloServiceBean"/>
    </camel:route>