Menu Close
13.2. Artemis コアクライアントの使用
Artemis コアクライアントは、qpid -jms-client
ではなく外部ブローカーに接続するために使用できます。
Artemis コアクライアントを使用した接続
-
Artemis コアクライアントを有効にするには Fuse を起動します。
FUSE_HOME
ディレクトリーに移動し、Windows では./bin/fuse
(Linux の場合はbin\fuse.bat
)を入力します。 -
feature:install artemis-core-client
コマンドを使用して、Artemis クライアントを機能として追加します。 - コードを作成している場合は、Camel コンポーネントを接続ファクトリーで接続する必要があります。
接続ファクトリーをインポートします。
import org.apache.qpid.jms.JmsConnectionFactory;
接続を設定します。
ConnectionFactory connectionFactory = new JmsConnectionFactory("amqp://localhost:5672"); try (Connection connection = connectionFactory.createConnection()) {