Skip to main content
Alumio acts as the intermediary: it receives the incoming request, optionally transforms it, forwards it to the target system, and returns the response to the caller.

What HTTP Proxies can do

HTTP Proxies give you control over how requests are handled between the consumer and the target system. You can:
  • Forward requests to a target system using a configured HTTP Client and URI.
  • Apply processors to modify the request before it is forwarded and the response before it is returned.
  • Restrict access using a Matcher to validate that requests come from a legitimate source.
  • Override the HTTP status code returned to the consumer using the HTTP response code processor.
  • Simulate requests using the built-in Configuration tester without needing an external system to trigger the call.
  • Answer requests from a Storage instead of the target system, for example, to shield a slow backend. See Answering from a Storage.

Filtering HTTP Proxies

The overview page lists all HTTP Proxies in your environment. Filters are available for Name, Created at, Updated at, and Labels. Use + Add Filter for additional conditions. Click any column header to sort.

Creating an HTTP Proxy

An HTTP Proxy is configured through two tabs: General and Advanced. The General tab defines the core connection: the target URI, HTTP method, HTTP Client, body parser format, and an optional Matcher to restrict access. The Advanced tab contains processors. Processors let you modify the request before it is forwarded and the response before it is returned to the consumer. Available processors include removing or setting headers, transforming request or response data, and setting a custom HTTP response code.

Using the Configuration tester

The Configuration tester is available on both the creation form and the detail page. It lets you send a test request in real time. You can configure the method, URI, headers, and protocol, and choose whether to send a real request or simulate one. The Response tab shows the result, including the response body, status code, and headers.

Custom HTTP status codes

By default, Alumio passes through the HTTP status code returned by the target system. The HTTP response code processor lets you override this. It has two methods:
  • STATIC returns one fixed status code (e.g. 201, 202, 204) for all responses from that HTTP Proxy, regardless of what the target system returns.
  • DYNAMIC sets the status code per response, for example 404 when a requested item does not exist.
Setting up a dynamic status code Add the HTTP response code processor to the processors applied on the response, on the Advanced tab, and select the Dynamic method. Then fill in:
  • Parser: the format of the response body of the target, for example Parse from JSON.
  • Conditions: one or more rules. Each rule has a condition (If this condition applies) and the status code to return (Then set this HTTP status code). Use Condition on field value with a pattern accessor to check a field in the response body. The rules are checked in order.
  • If no condition applies, then apply this HTTP status code: the status code returned when no rule matches.
For example, this setup turns the response of the Storage API into clear status codes for the consumer: The wildcard pattern must match the whole text of the field, so put * before and after the words you look for.

Answering from a Storage

An HTTP Proxy does not have to forward every request to the system behind it. It can also answer from a Storage, so the consumer gets a response without the target system being called. This is how you shield a slow backend: keep the data it would return in a Storage and let the proxy serve it from there. There are two ways to set this up. Option A: call the Alumio Storage API In this option, the proxy calls the Alumio Storage API instead of an external URL, and returns the storage content to the consumer. This option still makes an HTTP call, but to Alumio itself rather than to the backend.
  1. Create an API key under Access control → API Keys. Copy the access token right away, because it is not shown again. See API keys.
  2. Create an HTTP Client that sends the API key as a Bearer token in the Authorization header, with https://{environment}.alumio.com/api/v1 as the base URI. Store the token in an environment variable rather than in the HTTP Client itself.
  3. Create an HTTP Proxy and open the General tab.
  4. Set the target URI to the Storage API endpoint /storage/entity/{storage}, where {storage} is the identifier of the Storage, for example /storage/entity/products-cache. Do not add the item identifier to the target URI.
  5. Set the HTTP method to GET.
  6. Select the HTTP Client from step 2.
  7. Select Forward GET parameters, so the query parameters of the incoming request are passed on to the Storage API. Consumers then call the proxy with the item identifier as the entity query parameter, for example https://{environment}.alumio.com/api/v1/http-proxy/{proxy}?entity=SKU123, where {proxy} is the identifier of the HTTP Proxy. If the Storage belongs to a Space, consumers also add the Space identifier as the space query parameter.
  8. The Storage API returns the item as {"value": ..., "updatedAt": ...}. To return only the stored content to the consumer, add a Transform response data processor on the Advanced tab that returns the content of value.
  9. Test the proxy with the Configuration tester. Add ?entity= and a known item identifier to the URI, and choose to send a real request, not a simulated one, so the Storage API is actually called.
An API key is bound to the user who created it. All calls made with it are logged as that user’s activity in the Audit Trail, and the key is revoked automatically when that user is removed from the environment. If that happens, the proxy stops working. Create the key with an account that will stay active, and replace the key before removing its user.
Option B: mock the request and read the Storage in the response processor This option avoids HTTP calls altogether, including the call to the Storage API.
  1. On the General tab, set an external URL as the target URI. The URL is not called, so any valid URL works.
  2. On the General tab, select an HTTP Client that has the Mock requests plugin. The plugin makes the HTTP Client return a static mock response instead of executing the request.
  3. In the request processor, store any value from the incoming request that you need later with the Set global variable transformer, for example, the identifier of the item to return.
  4. In the response processor, read the value with @{globals.<key>} and use it in the Storage: Get item transformer to fetch the storage entity. The entity then becomes the response returned to the consumer.
For example, if you store the identifier under the key productId in the request processor, use @{globals.productId} as the identifier in the Storage: Get item transformer.
The Mock requests plugin is set on the HTTP Client and applies to every request the proxy makes. It is not the same as simulating a request in the Configuration tester, which only affects the test request you send from the tester.
Which option to use Option A is the simpler configuration. Option B has no HTTP round trip at all, so it is the faster choice when response time matters most. Filling the Storage The proxy only reads from the Storage, so something else has to keep it filled. Create a Route that retrieves the data from the backend on a schedule and saves each record with the Storage: Save item transformer. Use the value that consumers send in their request as the Storage item identifier, for example the product ID. The schedule of this Route determines how fresh the data is that the proxy returns. When the item does not exist With Option A, the Storage API currently returns 500 Internal Server Error when the item does not exist, with a body like this:
To give consumers a clearer answer, use the HTTP response code processor with the DYNAMIC method to return 404 instead. See Custom HTTP status codes. With Option B, if no item exists for the identifier, Storage: Get item leaves the data unchanged and adds nothing at its destination. If the identifier is empty, the run stops with an error. Handle both cases in the response processor, for example with an Apply transformer conditionally transformer that sets a clear response body such as {"error": "Item not found"} when the destination is empty. To also return 404, use the HTTP response code processor with the DYNAMIC method. Expiry (time to live) Expiry is set per Storage with Pruning, which deletes items older than the configured threshold. See Storages. A pruned item is missing until the Route that fills the Storage saves it again, so set the pruning threshold longer than the interval of that Route. Otherwise consumers get the not-found response for items that still exist in the backend.

Limits

HTTP Proxies have the following default limits:
These are default values. The actual throughput and the maximum payload size depend heavily on the server of the customer and the configuration of the HTTP Proxy.