How can I create an HTTP proxy using SwitchYard composite in FSW ?
Issue
- How can we create an HTTP proxy application in FSW ?
- After some discussion we came up with two solutions:
- SY service (HTTP-binding) -> Camel route -> SY reference (HTTP-binding)
- SY service (HTTP-binding) -> Camel route that actually routes to the HTTP-service provider
- However, there are considerations about the solutions:
- SY service (HTTP-binding) -> Camel route -> SY reference (HTTP-binding):
In this case the default HTTP binding component in SwitchYard will not work. The main problem is that we must have the possibility to change/construct the URL dynamically to the service-provider. - SY service (HTTP-binding) -> Camel route that actually routes to the HTTP-service provider:
In this case the routing is done via thecamel-httpcomponent orcamel-jettycomponent. As far as we can understand this solutions requires that we install those Camel components in SwitchYard.
- SY service (HTTP-binding) -> Camel route -> SY reference (HTTP-binding):
- More concrete examples:
- Example a http-service-proxy:
http://proxy-host/http/download?filename=test.txt
SY service (HTTP-binding):context-path=http/download
SY reference (HTTP-binding):address=service-provider-host/http/download
Problem: How do we pass along thequeryString=filename=test.txt? - Example a rest-service-proxy:
http://proxy-host/rest/customerservice/customer/10
Content-type=application/jsonorContent-type=application/xml
SY service (HTTP-binding):context-path=rest/customerservice
SY reference (HTTP-binding):address=service-provider-host/rest/customerservice
Problem: How do we pass along thepathInfo=customer/10and theContent-type?
- Example a http-service-proxy:
Environment
- Red Hat JBoss Fuse Service Works (FSW)
- 6.0.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
