Customize http ports & change "/cxf" to "/" for different services
lavin.korukanti Feb 10, 2014 5:35 PMHello All,
We have a requirement where in we have multiple services deployed on our container and these containers are in a cluster spread across different hosts.
Below is our Infra design
It has 2 hosts which have fuse software instlled. ssh is not available between the 2 nor is internet access. all containers created are children of either host.
Fuse ESB Version 6 and patch 5
? All containers on same version
? seprate profile for web service
? 3 jvms (2 root and one extra on server2) for ensemble cluster. These will not host any applications. They are purely meant for zookeeper registry.
? Camel/cxf fabs to be deployed in web service profile
? 2 jvms/containers for web services(one on each host)
? Setup custom port for webservice 9001.
We thought of achieving load balancing via a load balancer. ie create a vip for the 2 service endpoints. CSS being the load balancer.
Services are supposed to be deployed in 2 containers with the following configs:
Web-Service-1 URL =http://ip1:9001/contexrtoor1
Web-Service-1 URL=http://ip2:9001/contextroot1
Web-Service-2 URL =http://ip1:9001/contexrtoor2
Web-Service-2 URL=http://ip2:9001/contextroot2
The web service would be called by the consumers by using a loadbalancer VIP
We were able to cusmtomize the http ports by installing the cxf feature and pax web server and we have addded a custom filed in the file org.ops4j.pax.web.properties as org.osgi.service.http.port=9001 now our container is binded to 9001 but the issue is our web-service ends points are only accessible as
Web-Service-1 URL =http://ip1:9001/cxf/contexrtoor1
Web-Service-1 URL=http://ip2:9001/cxf/contextroot1
Web-Service-2 URL =http://ip1:9001/cxf/contexrtoor2
Web-Service-2 URL=http://ip2:9001/cxf/contextroot2
http://vip/cxf/contexroot1 and
if we remove '/cxf' from the context root is trowing a 404 error and this is not acceptable by the dev because as per the design they want the consumers to access their services as
I know that one solution will be to
Add org.apache.cxf.osgi.cfg file into $FUSE _ESB/etc/ folder, add an
entry
org.apache.cxf.servlet.context=/mycontext
but my doing that it is always explicitly set to only one service , and for the consumers to access other service again they should have to go through
Web-Service-2 URL =http://ip1:9001/contestroot1/contexrtoor2 , which is not desired by our architecture team since in future they could be many services running on this container and each service should have to be independently accessed.
Please kindly guide me on how to achieve this.
Thanks