이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 1. Deploying using an OSGi bundle


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()>
    Copy to Clipboard Toggle word wrap
  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
    Copy to Clipboard Toggle word wrap
  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
    Copy to Clipboard Toggle word wrap

    You will see a bundle ID returned:

    Bundle ID: 228
    Copy to Clipboard Toggle word wrap

    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! :
Copy to Clipboard Toggle word wrap

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

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat