- 浏览: 545228 次
- 性别:
- 来自: 西安
文章分类
- 全部博客 (251)
- UML/RUP/软件工程 (0)
- DDD:领域驱动设计 (1)
- IaaS/Paas/SaaS (1)
- Hadoop/YARN (10)
- PBDP项目 (2)
- OSGi-基础 (7)
- OSGi-Aries (2)
- OSGi-SpringDM (32)
- Oracle/MySQL/SS (8)
- Felix/Equinox/Bnd (14)
- Virgo Server/Gemini (7)
- Weblogic/JBoss/Tomcat (10)
- ActiveMQ (14)
- Camel (1)
- Spring Roo/Eclipse (7)
- Java/JSP/JSF (10)
- Maven (19)
- ESB-Mule (1)
- ESB-ServiceMix (18)
- SOA/SCA/SDO (12)
- WebService/RESTful (17)
- JS/jQuery/ExtJS (4)
- Spring/JPA/MVC (15)
- SpringSecurity (5)
- BPM/jBPM (3)
- Hudson/SVN/CI (0)
- LinuxOS/虚拟化 (25)
- Office/OpenOffice (1)
- 项目管理 (5)
- POI/jFreeChart (1)
最新评论
-
panamera:
请问JMS Transport 发布的webservice 是 ...
CXF 提供的Service Transport-JMS Transpor -
jianyi296:
where is attachment.
CXF WebService Dynamic Client -
hj01kkk:
您好,我用jdbc-user-service为什么每次验证时都 ...
SpringSecurity笔记3-Authenticating Users:Authenticaton Strategy -
wufenglin1231:
你好,我在实现Mapping exceptions to re ...
RESTful 异常处理 -
xchd:
[echo] Project: common
[echo ...
Hive安装配置学习笔记
FAB Project是以pom.xml配置文件为主进行该JAR文件的依赖解析的, 因此可以确保部署时期本JAR对第三方JAR文件
的依赖问题。
1. Generating a FAB Project
mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-blueprint -DarchetypeVersion=2.9.0.fuse-7-060 -DgroupId=GroupId -DartifactId=ArtifactId -Dversion=Version
进入到上面命令生成的Aritfactid文件夹下,执行:mvn install命令将在targst目录下生成JAR文件。
2. Class Sharing
FAB默认情况下是将每个Maven 依赖在运行期间添加至自己的私有的Class Space中的, 这样的优点:
可以避免统一依赖JAR的版本部一致问题;缺点是JVM需要在内存中维护每一个依赖JAR文件的Copy.
解决上述问题,有下面两个方案:
(1) 使用scope指定依赖的范围
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel-version}</version> <scope>provided</scope> </dependency>
(2) 使用Manifest.MF Header指定共享的依赖
例如,共享org.apache.camel GroupId下的所有AritfactId:
FAB-Provided-Dependency: org.apache.camel:*
3. 修改一个Maven Project让其适合FAB部署
(1)确保JAR文件的packaging 格式是:JAR
<project ... > ... <packaging>jar</packaging> ... </project>
(2) 指定JDK编译版本,仅仅指定JAVA_HOME和PATH环境变量是不够的
<project .> ... <build> <defaultGoal>install</defaultGoal> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build> ... </project>
(3)配置可分享的类或JAR,指定其scope为provided
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-http</artifactId> <version>2.9.0.fuse-7-060</version> <scope>provided</scope> </dependency>
(4) 将测试期间需要的依赖指定为test
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j-version}</version> <scope>test</scope> </dependency
(5) 针对WS Application使用cxf-bundle
<dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-bundle</artifactId> <version>2.5.0.fuse-7-060</version> <scope>provided</scope> </dependency
默认情况下cxf-bundle包含所有的CXF Bundle.
(6) 优先考虑使用Blueprin而不是Spring, 因为Blueprint是松耦合的,而Spring XML中引入的依赖FAB在部署期间易发生
ClassNotFound Exception.
(7) 使用Mainfest.MF Header配置可选的依赖,可使用通配符:*
FAB-Version-Range-Digits: 2
FAB-Provided-Dependency: org.apache.camel:*
4. Configuring a FAB
针对FAB部署,可在Mnifext.MF文件中添加许多Header:
(1) 指定版本范围
例如下面的pom中的依赖,生成后的JAR文件中的Mainfest.MF文件为:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>2.8.1-fuse-00-02</version> <scope>provided</scope> </dependency>
Import-Package: org.apache.camel;version="[2.8.1-fuse-00-02,2.9)"
指定版本范围策略,可通过Header: FAB-Version-Range-Digits: 2,可选值有:0,1,2,3,4
(2) 指定共享的依赖
FAB-Provided-Dependency: groupId1:artifactId1 groupId2:artifactId2 ...
例如:FAB-Provided-Dependency: org.apache.camel:* org.springframework:*
(3) 指定可选的依赖:
在pom.xml文件添加:<optional>true</optional>
或添加Header: FAB-Include-Optional-Dependency: *:*
(4) 指定OSGi 需要的Bundle:
FAB-Dependency-Require-Bundle: groupId1:artifactId1 groupId2:artifactId2 ...
(5) 指定不需要的依赖:
FAB-Exclude-Dependency: log4j logkit
(6) 客制化导入:
Import-Package: com.acme.special;version="[1.0,1.1)"
(7) Automatic feature detection
FAB-Skip-Matching-Feature-Detection: org.apache.camel
(8) Requiring features
FAB-Require-Feature-URL: mvn:org.apache.cxf.karaf/apache-cxf/2.5.0.fuse-7-060/xml/features
FAB-Require-Feature: cxf-sts
(9) Respecting pre-installed features and bundles
FAB-Install-Provided-Bundle-Dependencies: true
5. 配置Mainfest.MF文件Header
(1) 在pom文件中:
<project .> ... <build> ... <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin </artifactId> <configuration> <archive> <index>true</index> <manifestEntries> <FAB-Version-Range-Digits>0</FAB-Version-Range-Digits> <FAB-Provided-Dependency> org.apache.camel:* org.apache.cxf:* org.apache.activemq:* </FAB-Provided-Dependency> </manifestEntries> </archive> </configuration> </plugin> ... </plugins> </build> </project>
(2) 在META-INF/MANIFEST.MF文件中:
<project .> ... <build> ... <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin </artifactId> <configuration> <!-- lets use the default META-INF/MANIFEST.MF if its there --> <useDefaultManifestFile>true</useDefaultManifestFile> </configuration> </plugin> ... </plugins> </build> </project>
6. Deploying a FAB
FAB是用Maven构建工具创建的一个JAR文件,在这个JAR文件中有一个位于下面目录结构的pom.xml文件:
META-INF/maven/groupId/artifactId/pom.xml ,有两种部署方式:Hot Deploy和手工部署。
(1) 安装FAB及私有的依赖
这种方式与传统的WAR部署方式没什么打的区别,唯一的区别是FAB不需要和它的依赖部署在一起。
(2) 安装FAB及共享的依赖
这种方式与使用OSGi的命令安装Bundle没什么区别,并可以利用OSGi的Bundles和Features特性,及根据Features
特性自动安装需要的JAR。
(3) 安装FAB有私有的依赖也有共享的依赖
这种安装FAB的方式在FAB启动时只会启动FAB私有的依赖,而不会启动共享的依赖。
Hot Deploy:
将JAR 文件Copy 至安装目录下的deploy目录下。
Manual Deploy:
(1) 使用FAB scheme: osgi:install fab:mvn:groupId/artifactId/version 或fab:file:PathName 或fab:http:Host[:Port]/[Path]
(2) 启动FAB:fab:start 180 #180FAB ID
(3) 停止FAB:fab:stop 180
(4) 卸载FAB:fab:uninstall 180
7. Configuring Maven for FAB
配置文件位于:InstallDir/etc/org.ops4j.pax.url.mvn.cfg
客制化定义本地Repository:
# Path to the local maven repository which is used to avoid downloading
# artifacts when they already exist locally.
# The value of this property will be extracted from the settings.xml file
# above, or defaulted to:
# System.getProperty("user.home" ) + "/.m2/repository"
#
org.ops4j.pax.url.mvn.localRepository=file:~/.m2/repository
客制化定义远程Repository:
org.ops4j.pax.url.mvn.repositories= \ http://repo1.maven.org/maven2, \ http://repo.fusesource.com/nexus/content/repositories/releases, \ http://repo.fusesource.com/nexus/content/repositories/snapshots@snapshots@noreleases, \ http://repository.apache.org/content/groups/snapshotsgroup@snapshots@noreleases, \ http://svn.apache.org/repos/asf/servicemix/m2-repo, \ http://repository.springsource.com/maven/bundles/release,\ http://repository.springsource.com/maven/bundles/external
发表评论
-
使用Maven构建JBI组件
2012-08-29 18:06 12091. 配置POM文件 <pluginR ... -
JBI及相关组件理论
2012-08-28 12:42 11011. Java Business Integration(JB ... -
部署JBI组件至Fuse ESB Enterprise Runtime
2012-08-28 10:20 1348JBI Endpoint Cluster ... -
OSGi容器中Bundle之间Asynchronous Communication
2012-07-20 09:41 1637Fuse ESB Enterprise Contai ... -
OSGi容器中Bundle之间Synchronous Communication
2012-07-14 11:25 1279OSGi Core定义了一个服务层,提供了一个Bund ... -
Fuse ESB Enterprise之OSGi Bunbdle部署模型
2012-07-12 09:49 17151. Building an OSGi Bundle ... -
Fuse ESB Enterprise之WAR部署模型
2012-07-12 09:48 13051. Build a WAR Modifying ... -
FuseESB Enterprise 系统配置
2012-05-22 15:42 1729Fuse ESB Enterprise 使用Felix 实现的 ... -
FuseESB Enterprise Runtime 配置
2012-05-19 16:46 13920. FuseESB作为系统服务 (1) Ge ... -
FuseESB Enterprise Routing and Integration理论
2012-05-19 12:49 1056Fuse ESB Enterprise的内嵌的routing ... -
FuseESB Enterprise Messaging理论
2012-05-18 15:11 10201. The Embedded Messaging Servi ... -
ServiceMix中部署:WebService和OSGi Service
2012-02-04 22:47 1365部署Web Service 1. 2. 部署OSGi ... -
ServiceMix中部署:JAR和WAR
2012-02-04 14:34 1726部署JAR: 1. Transform a non-OSGi ... -
ServiceMix中部署:OSGi Bundle和Feature
2012-02-04 11:49 4208部署单个Bundle: 1. Hot Deployment ... -
Maven管理ServiceMix工程
2012-02-03 20:50 15041. 添加fusersource respository至se ... -
FuseESB Enterprise理论及架构思想
2012-01-31 12:01 1195官方对FuseESB的定义: Fuse ESB is an ... -
FuseESB Enterprise/ServiceMix安装配置
2012-01-31 10:45 2603ServiceMix安装配置: 1. 安装准备 a ...
相关推荐
Fuse ESB 4.3.1 个人使用 笔记
fuse esb 详细配置,开发。camel,activemq,osgi深入浅出。
介绍了主流商业和开源ESB的发展趋势、可借鉴的地方和其缺点。主要介绍开源的。 ... 2.ServiceMix/FUSE ESB 3.Oracle Service Bus 4.Jboss ESB 4.WebSphere Message Broker 5.Synapse/WSO2 ESB
官网下载实在太慢.................
官网下载实在太慢.................
保险丝 JBoss Fuse是一个开源ESB,在单个集成发行版中具有基于Apache Camel,Apache CXF,Apache ActiveMQ,Apache Karaf和Fabric8的功能。
对商业、开源企业服务总线产品进行比较: 主要内容: 介绍了主流商业和开源ESB的发展趋势、可借鉴的地方和其缺点。 主要介绍: Oracle Service Bus WebSphere Message ... ServiceMix/FUSE ESB Synapse/WSO2 ESB
主要内容: 介绍了主流商业和开源ESB的发展趋势、可借鉴的地方和其缺点。 主要介绍: Oracle Service Bus WebSphere Message Broker Mule ServiceMix/FUSE ESB Synapse/WSO2 ESB
Spring微服务保险丝
介绍了主流商业和开源ESB的发展趋势、可借鉴的地方和其缺点。 主要介绍: Oracle Service Bus WebSphere Message Broker Mule ServiceMix/FUSE ESB Synapse/WSO2 ESB
Hello Keith 使用 JBoss Fuse ESB、JBoss Fuse MQ 和 Fabric 构建高度可扩展的消息传递解决方案的示例。 该示例将展示如何使用 Fabric 创建多个容器以动态扩展和发现 ESB 内的服务。 该示例将展示如何使用自定义...
fuse esb 第二部分。总共分割了五分
#Camel Helloworld 保险丝在 jboss-fuse-6.1.0.redhat-379 上测试##部署(普通保险丝) 可以通过多种方式部署到普通保险丝(无织物)中: ###通过部署文件夹这假设您的容器上已经运行了骆驼功能cp target/camel-...
本文仅针对Fuse(熔断器)选型,PPTC&CPTC及其他过流保护装置或电路不在其列。针对Fuse设计选型相关基础知识介绍及选型参考标准、选型方法介绍等内容。
Fuse React是用React钩子编写的(React的新特性允许您在不编写类的情况下使用状态和其他React特性)。 Fuse React是一个完整的React管理模板,遵循谷歌的材料设计指南。 Fuse React管理模板使用Material UI V5作为...
fuse的最新版本,fuse是用户自己空间上的文件系统,
fuse-2.8.4
Fuse应用市场之手机市场,重点介绍FUSE在手机市场上应用案例~
FUSE文件系统参考
fuse-2.9.3.tar.gz