検索

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

Chapter 1. Deploying using an OSGi bundle

download PDF

Abstract

The usual and most common method of deploying into Apache Karaf is using an OSGi bundle.

1.1. OSGi overview

Apache Karaf is structured to use OSGi functionality. For more information about the structure of Apache Karaf see Chapter 2, Introduction to OSGi.

An OSGi bundle is a collection of JAR files with configuration files, bundled up into a JAR. For more information about creating OSGi bundles see Chapter 3, Building an OSGi Bundle.

1.2. Prerequisites

Before following the instructions make sure that you have completed the following prerequisites:

1.3. Preparing the OSGi bundle

For this example we will use a quickstart, which is a ready-prepared bundle. Quickstarts can be found in FUSE_HOME/quickstarts

To find out more about how to build your own OSGi bundle, see Section 3.1, “Generating a Bundle Project” .

1.4. Deploying the OSGi bundle

The OSGi bundle is deployed into a running Apache Karaf instance.

  1. Start Fuse from the bin direction by executing the ./fuse script in the FUSE_HOME/bin/ directory.

    You will see the prompt:

    karaf@root()>
  2. On a separate terminal, navigate to the FUSE_HOME/quickstarts/beginner/camel-log directory. camel-log is the name of the quickstart we will use to create a bundle.
  3. Compile the camel-log quickstart using Maven:

    $  mvn clean install
  4. Return to the Karaf terminal and install the project:

    karaf@root()> bundle:install -s mvn:org.jboss.fuse.quickstarts/beginner-camel-log/$CURRENT_VERSION

    You will see a bundle ID returned:

    Bundle ID: 228

    This is a unique identifier for this bundle on this instance of Fuse

  5. To see the output of project, look in the log file at FUSE_HOME/data/log/fuse.log The output will look like this:
12:07:34.542 INFO [Camel (log-example-context) thread #1 - timer://foo] >>> Hello from Fuse based Camel route! :
12:07:39.530 INFO [Camel (log-example-context) thread #1 - timer://foo] >>> Hello from Fuse based Camel route! :
12:07:44.530 INFO [Camel (log-example-context) thread #1 - timer://foo] >>> Hello from Fuse based Camel route! :

For more information about deploying OSGi bundles, see Chapter 4, Hot deployment vs manual deployment.

Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

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

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

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

会社概要

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

© 2024 Red Hat, Inc.