Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The HTTP/2 Server agent enables you to configure an HTTP server in a real-time workflow. The agent receives requests, converts them into UDRs routed into the workflow, and then sends responses back over a TCP/IP connection.

...

SettingDescription

Use OpenAPI Profile

Select this option if you want the agent to use an OpenAPI profile.

OpenAPI ProfileIf Use OpenAPI Profile has been selected, select which profile to use in this field.
Enable Validation

Select this option if you want to validate the OpenAPI profile.

Note
titleNote!

Turning this option ON will have a very significant performance impact on the overall performance of the flow. When validation is enabled, each payload will be validated against the Open API schema, an operation that can be very resource-intensive. We recommend to only enable this setting during development and testing and to disable it in a stable production environment.


Override Error Response on Server ShutdownSelect this option to enable the customization of the HTTP response for when a request to the server is received upon the server being terminated.
Override Error Response on Server Overload

Select this option to enable the customization of the HTTP response for when a request to the server is received upon the server being overloaded.

Note
titleNote!

Overload protection should be enabled to utilize this feature.


Status CodeThe HTTP error code for the error response. The default error code set is 503 for server shutdown and 429 for server overload.
Content Type

Enter the media type to be used as part of the HTTP header for the response. The default media type is "application/problem+json".

UDR TypeBrowse for the UDR that will be populated as part of the  HTTP response message.
UDR FieldThe fields in the selected UDR Type will be shown in this column.
Type

The data type for the each of the UDR fields will be shown here. Usage Engine supports the following data type:

  • String
  • BigInt
  • Boolean
  • Int
ValueEnter a value that conforms to the data type of the UDR field. The value will then be parsed into the HTTP response when the error is triggered.
Use 5G ProfileSelect this option if you want the agent to use a 5G profile.
5G ProfileIf Use 5G Profile has been selected, select which profile to use in this field.
NRF Address Enter the primary NRF (NF Repository Function) address in this field.
Reconnect to primary address when it is availableEnable this option to have the agent fall back to the primary NRF address from the secondary address. The agent to constantly send a registration request to the primary NRF address at every heartbeat interval. The heartbeat interval will be based off of the value that you have configured in the 5G profile.
NRF Address (Secondary)Enter one or more secondary NRF (NF Repository Function) address in this list, this is to allow for alternative connections when the heartbeat with the primary NRF Address is not established.

...

Code Block
languagejava
import ultra.openapi.Test_5G.TS29510_Nnrf_NFDiscovery;
consume {

    http.RequestCycle cycleUdr = (http.RequestCycle) input;
    
    debug("input from client \n" + cycleUdr);
    
    ProblemDetails problemDetails = udrCreate(ProblemDetails);
    http.Response response = udrCreate(http.Response);
    
    if (cycleUdr.isError) { // cycleUdr.isError will be true if any errors is encountered while processing the request
	 	list<string> headers = listCreate(string);
        listAdd(headers, "application/problem+json");
        mapSet(response.headers, "Content-Type", headers);
 
        problemDetails.title = "Request Error";
 	       problemDetails.cause = listGet(cycleUdr.errorMessages[, 0]); // cycleUdr.errorMessages is a list containing error messages set from the error encountered        
        problemDetails.status = cycleUdr.errorStatusCode; // cycleUdr.errorStatusCode contains the status code of the error encountered

        response.openAPIUDR = problemDetails;
        response.statusCode = cycleUdr.errorStatusCode;
    } 

    cycleUdr.response = response;
    debug("after apl logic \n" + cycleUdr);

    udrRoute("to_server", cycleUdr);
}

...