fabric8io / fabric8

fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
http://fabric8.io/
1.76k stars 504 forks source link

Rest API - Reduce the number of CXF JARs to not be bloated #1747

Closed davsclaus closed 10 years ago

davsclaus commented 10 years ago

CXF is used to exposes a new REST service. But we should try to reduce the number of CXF JARs installed out of the box, as its currently bloated with adding 80+ jars or thereabouts.

Fabric8:karaf@root> list -t 0 | grep -i cxf
[ 127] [Active     ] [Created     ] [       ] [   40] Apache CXF API (2.7.11)
[ 128] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime Core (2.7.11)
[ 129] [Active     ] [            ] [       ] [   40] Apache CXF Runtime Management (2.7.11)
[ 130] [Active     ] [Created     ] [       ] [   40] Apache CXF Karaf Commands (2.7.11)
[ 133] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime HTTP Transport (2.7.11)
[ 135] [Active     ] [            ] [       ] [   40] Apache CXF Runtime XML Binding (2.7.11)
[ 136] [Active     ] [            ] [       ] [   40] Apache CXF JAX-RS Extensions: Providers (2.7.11)
[ 137] [Active     ] [            ] [       ] [   40] Apache CXF JAX-RS Extensions: Search (2.7.11)
[ 138] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime JAX-RS Frontend (2.7.11)
[ 151] [Active     ] [            ] [       ] [   40] Apache CXF Runtime JAXB DataBinding (2.7.11)
[ 152] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime SOAP Binding (2.7.11)
[ 153] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime Simple Frontend (2.7.11)
[ 154] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime JAX-WS Frontend (2.7.11)
[ 155] [Active     ] [            ] [       ] [   40] Apache CXF Runtime Aegis Databinding (2.7.11)
[ 157] [Active     ] [            ] [       ] [   40] Apache CXF Runtime XmlBeans DataBinding (2.7.11)
[ 158] [Active     ] [            ] [       ] [   40] Apache CXF Runtime CORBA Binding (2.7.11)
[ 159] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime Colocated Binding (2.7.11)
[ 160] [Active     ] [            ] [       ] [   40] Apache CXF Runtime Local Transport (2.7.11)
[ 161] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime Object Binding (2.7.11)
[ 162] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime HTTP Jetty Transport (2.7.11)
[ 166] [Active     ] [            ] [       ] [   40] Apache CXF Runtime JMS Transport (2.7.11)
[ 167] [Active     ] [            ] [       ] [   40] Apache CXF Runtime UDP Transport (2.7.11)
[ 168] [Active     ] [            ] [       ] [   40] Apache CXF XJC Runtime (2.6.2)
[ 170] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime WS Policy (2.7.11)
[ 179] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime WS Addressing (2.7.11)
[ 181] [Active     ] [            ] [       ] [   40] Apache CXF Runtime WS Security (2.7.11)
[ 182] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime WS Reliable Messaging (2.7.11)
[ 183] [Active     ] [            ] [       ] [   40] Apache CXF Runtime WS MetadataExchange (2.7.11)
[ 184] [Active     ] [            ] [       ] [   40] Apache CXF Runtime JavaScript Client Generator (2.7.11)
[ 186] [Active     ] [            ] [       ] [   40] Apache CXF Runtime JavaScript Frontend (2.7.11)
[ 187] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime Clustering (2.7.11)
[ 188] [Active     ] [            ] [       ] [   50] Apache CXF Compatibility Bundle Jar (2.7.11)

The list ends at

[ 235] [Active     ] [            ] [       ] [   60] Apache Aries Util (1.1.0)

it use to be much much less - and there is bunch of other JARs added as well.

Frankly in 2014 it ought to be possible to uses a few JARs for REST with CXF.

Also there is a 2.6.2 JAR in there

[ 168] [Active     ] [            ] [       ] [   40] Apache CXF XJC Runtime (2.6.2)

Also I wonder if we could name CXF better in JMX instead of these UUID names that does not give an sense to end users what the *\ it is screen shot 2014-06-14 at 10 08 57 am

Yes I dislike when frameworks does not expose human understandable information, if not then do NOT - Yes CXF I am looking at you! It should be possible, as eg the Karaf commands shows

Fabric8:karaf@root> cxf:list-busses
Name                                     State
[io.fabric8.fabric-rest-cxf2032402282  ] [RUNNING           ]
Fabric8:karaf@root> cxf:list-endpoints
Name                      State      Address                                                      BusID
[FabricResource         ] [Started ] [/fabric8                                                  ] [io.fabric8.fabric-rest-cxf2032402282  ]

But that bus id in the karaf shell is NOT the same as in JMX/MBean :(

2032402282 vs org.apache.cxf:bus.id=cxf1479277003,type=Bus,instance.id=1479277003

WillemJiang commented 10 years ago

@davsclaus CXF provides "cxf-jaxrs" feature to install the less than 10 bundles. We need to avoid using "cxf" which includes all the CXF related bundles if we know the exact type of service which CXF need to expose.

jstrachan commented 10 years ago

thanks for the heads up @WillemJiang, I just switched the fabric-cxf feature to use cxf-jaxrs so now I get this which is much more like it:

Fabric8:karaf@root> list -s | grep cxf
[ 127] [Active     ] [Created     ] [   40] org.apache.cxf.cxf-api (2.7.11)
[ 128] [Active     ] [Created     ] [   40] org.apache.cxf.cxf-rt-core (2.7.11)
[ 129] [Active     ] [            ] [   40] org.apache.cxf.cxf-rt-management (2.7.11)
[ 130] [Active     ] [Created     ] [   40] org.apache.cxf.karaf.cxf-karaf-commands (2.7.11)
[ 133] [Active     ] [Created     ] [   40] org.apache.cxf.cxf-rt-transports-http (2.7.11)
[ 135] [Active     ] [            ] [   40] org.apache.cxf.cxf-rt-bindings-xml (2.7.11)
[ 136] [Active     ] [            ] [   40] org.apache.cxf.cxf-rt-rs-extension-providers (2.7.11)
[ 137] [Active     ] [            ] [   40] org.apache.cxf.cxf-rt-rs-extension-search (2.7.11)
[ 138] [Active     ] [Created     ] [   40] org.apache.cxf.cxf-rt-frontend-jaxrs (2.7.11)
[ 139] [Active     ] [            ] [   60] io.fabric8.fabric-cxf (1.1.0.SNAPSHOT)
[ 140] [Active     ] [            ] [   60] io.fabric8.fabric-cxf-registry (1.1.0.SNAPSHOT)
jstrachan commented 10 years ago

@davsclaus I guess the use of mbean names is maybe a CXF issue? Have a PR for the cxf jars coming soon...