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

Chapter 259. RMI Component


Available as of Camel version 1.0

The rmi: component binds Exchanges to the RMI protocol (JRMP).

Since this binding is just using RMI, normal RMI rules still apply regarding what methods can be invoked. This component supports only Exchanges that carry a method invocation from an interface that extends the Remote interface. All parameters in the method should be either Serializable or Remote objects.

Maven users will need to add the following dependency to their pom.xml for this component:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-rmi</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>
Copy to Clipboard Toggle word wrap

259.1. URI format

rmi://rmi-regisitry-host:rmi-registry-port/registry-path[?options]
Copy to Clipboard Toggle word wrap

For example:

rmi://localhost:1099/path/to/service
Copy to Clipboard Toggle word wrap

You can append query options to the URI in the following format, ?option=value&option=value&…​

259.2. Options

The RMI component has no options.

The RMI endpoint is configured using URI syntax:

rmi:hostname:port/name
Copy to Clipboard Toggle word wrap

with the following path and query parameters:

259.2.1. Path Parameters (3 parameters):

Expand
NameDescriptionDefaultType

hostname

Hostname of RMI server

localhost

String

name

Required Name to use when binding to RMI server

 

String

port

Port number of RMI server

1099

int

259.2.2. Query Parameters (6 parameters):

Expand
NameDescriptionDefaultType

method (common)

You can set the name of the method to invoke.

 

String

remoteInterfaces (common)

To specific the remote interfaces.

 

List

bridgeErrorHandler (consumer)

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

boolean

exceptionHandler (consumer)

To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.

 

ExceptionHandler

exchangePattern (consumer)

Sets the exchange pattern when the consumer creates an exchange.

 

ExchangePattern

synchronous (advanced)

Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

false

boolean

259.3. Using

To call out to an existing RMI service registered in an RMI registry, create a route similar to the following:

from("pojo:foo").to("rmi://localhost:1099/foo");
Copy to Clipboard Toggle word wrap

To bind an existing camel processor or service in an RMI registry, define an RMI endpoint as follows:

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

Note that when binding an RMI consumer endpoint, you must specify the Remote interfaces exposed.

In XML DSL you can do as follows from Camel 2.7 onwards:

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

259.4. See Also

  • Configuring Camel
  • Component
  • Endpoint
  • Getting Started
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

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

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

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

会社概要

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

Theme

© 2025 Red Hat