How to propagate HTTP status code in REST service proxy SwitchYard application in FSW

Solution Verified - Updated -

Issue

  • I have a SwitchYard service which basically acts as an proxy to a REST service.
  • If an HTTP error code is returned from the REST service, I want the SwitchYard service to return the same HTTP response.
  • However, if HTTP 400 or some other error code is returned from the REST service, the SwitchYard service simply returns HTTP 500.
  • What is the best way to make sure the SwitchYard service returns the same HTTP error code as is thrown from the REST service?

Environment

  • Red Hat JBoss Fuse Service Works (FSW) 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content