Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
1.3. Understanding the Example
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The example builds a simple HelloWorld service and packages it for deployment into Red Hat JBoss Fuse. The service is written using standard JAX-WS APIs. It implements a single operation
sayHi()
. Once deployed, the service is exposed as a SOAP/HTTP endpoint. The most interesting parts of the example are the Spring configuration used to configure the endpoint and the Maven POM used to build the bundle.
The Spring configuration provides the details needed to expose the service using SOAP/HTTP. It can also contain details used to configure advanced Apache CXF functionality.
The Maven POM, in addition to compiling the code, uses the bundle generation plug-in to package the resulting classes into an OSGi bundle. It contains all of the details needed by the Red Hat JBoss Fuse container to activate the bundle and deploy the packaged service.
Using the Maven tools 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The Red Hat JBoss Fuse Maven tooling automates a number of the steps in packaging functionality for deployment into JBoss Fuse. In order to use the Maven OSGi tooling, you add the elements shown in Example 1.2, “POM Elements for Using Red Hat JBoss Fuse OSGi Tooling” to your POM file.
Example 1.2. POM Elements for Using Red Hat JBoss Fuse OSGi Tooling
These elements point Maven to the correct repositories to download the Red Hat JBoss Fuse Maven tooling and load the plug-in that implements the OSGi tooling.
The Spring configuration 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The Red Hat JBoss Fuse container needs some details about a service before it can instantiate and endpoint for it. Apache CXF uses Spring based configuration to define endpoints for services. The configuration shown in Example 1.3, “OSGi Example Spring Configuration” is stored in the example's
\src\main\resources\META-INF\spring\beans.xml
file.
Example 1.3. OSGi Example Spring Configuration
The configuration shown in Example 1.3, “OSGi Example Spring Configuration” does the following:
- 1
- Imports the required configuration to load the required parts of the Apache CXF runtime.
- 2
- Configures the endpoint that exposes the service using the
jaxws:endpoint
element and its attributes.id
is an identifier used by the configuration mechanism.implementor
specifies the class that implements the service. It must be on the classpath.address
specifies the address at which the service will be exposed. This address is relative to the containers HTTP address withcxf
appended to it.
The POM 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Example 1.4. OSGi POM