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

2.2. Hot Deployment


Types of configuration file

You can hot deploy the following types of configuration file:
  • Spring XML file, deployable with the suffix, .xml.
  • Blueprint XML file, deployable with the suffix, .xml.

Hot deploy directory

If you have an existing Spring XML or blueprint XML configuration file, you can deploy the configuration file directly by copying it into the following hot deploy directory:
InstallDir/deploy
Copy to Clipboard Toggle word wrap
After deploying, the configuration file is activated immediately.

Hot undeploying an XML file

To undeploy a Spring XML file or a Blueprint XML file from the hot deploy directory, simply delete the XML file from the InstallDir/deploy directory while the Apache Karaf container is running.
Important
The hot undeploy mechanism does not work while the container is shut down. If you shut down the Karaf container, delete the XML file from deploy/, and then restart the Karaf container, the automatically generated bundle corresponding to the XML file will not be undeployed after you restart the container (you can, however, undeploy the bundle manually using the osgi:uninstall console command).

Prerequisites

If you want to deploy Apache Camel routes in a blueprint configuration file, the camel-blueprint feature must be installed (which it is by default). If the camel-blueprint feature has been disabled, however, you can re-install it by entering the following console command:
JBossFuse:karaf@root> features:install camel-blueprint
Copy to Clipboard Toggle word wrap

Default bundle version

When a Spring XML file or a Blueprint XML file is hot deployed, the XML file is automatically wrapped in an OSGi bundle and deployed as a bundle in the OSGi container. By default, the generated bundle has the version, 0.0.0.

Customizing the bundle version

If you prefer to customize the bundle version, use the manifest element in the XML file. The manifest element enables you to override any of the headers in the generated bundle's META-INF/MANIFEST.MF file. In particular, you can use it to specify the bundle version.

Specifying the bundle version in a Spring XML file

To specify the bundle version in a hot-deployed Spring XML file, define a manifest element as follows:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       >

  <manifest xmlns="http://karaf.apache.org/xmlns/deployer/spring/v1.0.0">
      Bundle-Version = 1.2.3.4
  </manifest>

  <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="timer://myTimer?fixedRate=true&amp;period=2000"/>
      <to uri="log:ExampleRouter"/>
    </route>
  </camelContext>

</beans>
Copy to Clipboard Toggle word wrap
The manifest element for Spring XML files belongs to the following schema namespace:
http://karaf.apache.org/xmlns/deployer/spring/v1.0.0
Copy to Clipboard Toggle word wrap
The contents of the manifest element are specified using the syntax of a Java properties file.

Specifying the bundle version in a Blueprint XML file

To specify the bundle version in a hot-deployed Blueprint XML file, define a manifest element as follows:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >

  <manifest xmlns="http://karaf.apache.org/xmlns/deployer/blueprint/v1.0.0">
      Bundle-Version = 1.2.3.4
  </manifest>

  <camelContext xmlns="http://camel.apache.org/schema/blueprint">
    <route>
      <from uri="timer://myTimer?fixedRate=true&amp;period=2000"/>
      <to uri="log:ExampleRouter"/>
    </route>
  </camelContext>

</blueprint>
Copy to Clipboard Toggle word wrap
The manifest element for Blueprint XML files belongs to the following schema namespace:
http://karaf.apache.org/xmlns/deployer/blueprint/v1.0.0
Copy to Clipboard Toggle word wrap
The contents of the manifest element are specified using the syntax of a Java properties file.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat