How can I create an HTTP proxy using SwitchYard composite in FSW ?

Solution Verified - Updated -

Issue

  • How can we create an HTTP proxy application in FSW ?
  • After some discussion we came up with two solutions:
    1. SY service (HTTP-binding) -> Camel route -> SY reference (HTTP-binding)
    2. SY service (HTTP-binding) -> Camel route that actually routes to the HTTP-service provider
  • However, there are considerations about the solutions:
    1. 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.
    2. SY service (HTTP-binding) -> Camel route that actually routes to the HTTP-service provider:
      In this case the routing is done via the camel-http component or camel-jetty component. As far as we can understand this solutions requires that we install those Camel components in SwitchYard.
  • More concrete examples:
    1. 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 the queryString = filename=test.txt ?
    2. Example a rest-service-proxy: http://proxy-host/rest/customerservice/customer/10
      Content-type = application/json or Content-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 the pathInfo = customer/10 and the Content-type ?

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.

Current Customers and Partners

Log in for full access

Log In