Direct Proxy

Version: 17.07

Supported Since: 17.01

Use case description

I want to proxy my web service calls by introducing a intermediate proxy service of the UltraESB-X. This proxy service is not supposed to do processing and it will directly route the receiving HTTP calls to the actual back end service.

Proposed Solution

As shown in the following diagram, ESB will come in between the actual end user and the back end service.

direct proxy

UltraStudio Configuration

UltraESB-X Configuration

Implementation of the Solution

Prerequisite

In order to implement above use case you must first select following dependencies when you are creating a new Ultra project.

  • HTTP NIO Connector from the connector list

If you have already created a project, you can add above dependencies via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list and Processors list, select above dependencies.
Implementation

To implement above use case, first create an integration flow named “direct-proxy”, and then add required components by going through following steps in order.

  1. Add a HTTP NIO Ingress Connector from the Connectors → Ingress Connectors list, to accept the HTTP requests from the user. NIO HTTP Listener’s basic parameters should be filled as below to expose a service at port 8280 on the resource path /service/direct-proxy

  2. Add a HTTP NIO Egress Connector from the Connectors → Egress Connectors list, to send the received request to the actual back end service. For that NIO HTTP Egress Connector’s basic parameters should be filled as below table.

The completed integration flow should look like below.

direct proxy 1

Configuration for each element is as below. The numbering corresponds to the numbers shown in above diagram.

Design View

Text View

.

1.NIO HTTP Ingress Connector

direct proxy 2

2.NIO HTTP Egress Connector

direct proxy 3
.

1.NIO HTTP Ingress Connector

Http Port

8280

Service Path

/service/direct-proxy

2.NIO HTTP Egress Connector

Destination Address Type

URL

Destination Host

localhost

Destination Port

9000

Service Path

/service/EchoService

.

Now you can run the Ultra Project and check the functionality of the integration flow. Create an UltraESB Server run configuration and start it.

Property Configuration

When running the sample in the UltraESB-X distribution, you need to override the following properties in-order for the sample to work. The properties file is located at $ULTRA_HOME/conf/projects/direct-proxy/default.properties

Refer to Managing Project Properties documentation on how to override properties.

direct-proxy-flow.egress-connector.host

The Hostname of the back end server (default value is localhost)

direct-proxy-flow.egress-connector.port

The Port of the backend server (default value is 9000)

direct-proxy-flow.egress-connector.servicePath

The Service Path of the backend server (default value is /service/EchoService)

direct-proxy-flow.ingress-connector.path

The Service Path of the proxy listener (default value is /service/direct-proxy)

direct-proxy-flow.ingress-connector.port

The Service Port of the proxy listener (default value is 8280)

After that navigate to $ULTRA_HOME/bin directory. Next you can run the UltraESB-X distribution with following command to start the engine with this sample project deployed.

./ultraesbx.sh -sample direct-proxy

Testing the Integration Project

  1. Start an HTTP server instance on port 9000, which will expose an endpoint on the service path service/EchoService. This endpoint should be able to accept POST requests and echo back the request it received as a response.

  2. Send a POST HTTP request containing any payload to http://localhost:8280/service/direct-proxy. (You can use the HTTP Client shipped with Ultra Studio Toolbox for this purpose). You will get a response with the same content you have included in the request since our backend is an echo server.

In this topic
In this topic
Contact Us