Version: 17.01
Supported Since: 17.01
The HTTP NIO Ingress Connector is used to receive HTTP messages from a remote client by listening to a specific port on a specific service path and injects those messages in to the ESB engine. HTTP NIO Ingress Connector supports HTTP RFC 2616.
In order to use the HTTP NIO Ingress Ingress Connector you must first select the “HTTP NIO Connector” dependency from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add the “HTTP NIO Connector” dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list, select the “HTTP NIO Connector” dependency.
NIO HTTP Ingress connector needs ram-mounted directory (a Ram Disk) to operate. Make sure the directory /tmp/ram is already created with the appropriate permissions and it is mounted on the ram. |
To test the Http ingress connector, you will need a HTTP client tool. With AdroitLogic Ultra Studio we have a handy HTTP/S client tool which you can send HTTP or HTTPS requests. You can find this tool by clicking on Ultra Studio Toolbox IDEA Tool Window Bar button and then clicking on the plus(+) sign on the top left of the opened Tool Window and then selecting HTTP/S Client. Please refer to the Figure 1. After clicking on that you’ll get a nice HTTP Client interface to send HTTP messages as shown in the Figure 2.
In this sample we’ll create a integration flow which is able to receive a HTTP message from a remote client, add a custom HTTP header to the message and then send it back to the original client as a HTTP response.
Let’s create a new Integration Flow named "SampleHttpFlow" and switch to the Design view using the tab buttons located at the bottom left of the editor. Search for "NIO HTTP Listener" connector and drag and drop in the editor. In the configuration tab below specify the Http port as 8280 and Service Path as /service/echo-service . Don’t forget to hit the save button when your are done.
Then we’ll add a Processing Element to add a new HTTP header to the received message before sending it in to the response path. Search for "Add New Transport Header" processing element and add it to the editor like before. Configurations should be looks like as in the Figure 4.
Next complete the integration flow by connecting thr elements as shown in Figure 5 below.
Now create a run configuration if one not already configured and then run the project. Take a look at the logs printed out on the IDEA Run Tool window, you will be able to see that the UltraESB server is started and listening on the port 8280
It’s the time to send a HTTP Request and test our flow. Open the HTTP/S client Tool Window and set a sample request payload in the text box located in the left. After setting the URL text field as well you can send the message out. When the response received, inspect the Response text box you’ll find the MyHeader HTTP header. Take a good look at Figure 6.
Processor |
The message received to the Ingress Connector will be emitted through this outport |
On Exception |
The message will be sent to this outport if the Ingress Connector fails to transform the payload due to some reason |
input |
The message will be sent to this outport if the Ingress Connector fails to transform the payload due to some reason |
* marked fields are mandatory
Http port * |
Basic |
The port value which the Ingress Connector should be listening on. Must be an Integer value between 0 to 65535 |
Service path * |
Basic |
The path which the Ingress Connector can be reached. |
Response Timeout |
Advanced |
Ingres Connector will be timeout when the value specified here exceeds without getting a response to the input out port |
IO thread count |
Transport Configuration |
Number of IO Threads to be assigned to accept http requests |
Local bind address |
Transport Configuration |
The local address to bind when the ingress connector is started. If not specified, binds on all interfaces by default |
Connection debugging enabled |
Transport Configuration |
Whether to enable connection debug or not. Connection debug gives you a log if something went wrong in connection level |
Connection debug headers |
Transport Configuration |
A comma separated list of HTTP headers to be dumped on a connection failure, when connection debugging is enabled. Specify as 'all' to dump all headers or as 'none' to prevent dumping of headers. |
Allowed HTTP methods |
Transport Configuration |
The HTTP methods allowed for requests processed via this Ingress Connector (multiple methods can be selected) |
Zero copy enabled |
Transport Configuration |
Whether to enable zero copying or not. Read more about Zero-Copy |
Turn off response compression |
Transport Configuration |
Whether to turn off the use of Gzip compression even if the request contains an Accept-Encoding header |
Compressing trigger size |
Transport Configuration |
The minimum size of a response (in bytes) to trigger compression, if supported by the client. Default value is 2K bytes |
Continue on runtime exceptions |
Transport Configuration |
Whether the engine should continue execution on the occurrence of a runtime exception. If set to false, engine will shutdown and restart on such a situation |
Continue on checked exceptions |
Transport Configuration |
Whether the engine should continue execution on the occurrence of a checked exception. If set to false, engine will shutdown and restart on such a situation |
Stop new connections at |
Transport Configuration |
The connection limit on which the reactor should pause accepting new connections. Default value is 4096. In reality this limit maybe surpassed. |
Resume new connections at |
Transport Configuration |
The connection limit on which the reactor should resume accepting new connections. Default value is 3072. |
Maximum payload size |
Transport Configuration |
The maximum payload size to accept (in bytes). Default value is 1MB. |
Tuning parameters |
Transport Configuration |
Specify a map of HTTP tuning parameters as a resource. |
key | Description |
---|---|
x.http.conn_remote_addr |
Remote IP address that the http request sent from |
x.http.conn_remote_port |
Remote Port that the http request sent from |
x.http.conn_local_addr |
Local IP address that the request received |
x.http.conn_local_port |
Local Port that the request received |
x.http.service_url |
The service url that the request received |
key | Description |
---|---|
x.http.query_string |
String representation of URL query parameters Note: the query string MUST be treated as read-only and any changes to this string wont be effective for the message being sent out from the ESB. |
x.http.query_param_map_wdups |
Holds a Map<String, List<String>> of URL query parameters including duplicates. This Map can be changed during the flow, and the resulting values re-used if the message is forwarded |
x.http.method |
HTTP method of received HTTP request |
x.http.message_size |
The size of the received message over HTTP. Note: This is only available for requests and responses received - and not for messages about to be sent out |
x.http.header_size |
The size of the received message header over HTTP. Note: This is only available for requests and responses received - and not for messages about to be sent out |
x.http.entity_size |
The size of the received message payload over HTTP. NOTE: This is only available for requests and responses received - and not for messages about to be sent out |
ultra.transport.address_url_postfix |
The message property which could hold a postfix for a "prefix" type address. The final address used to send a message is computed as: <prefix address> + <postfix> |
Code |
Description |
101000 |
The error code indicating an error during sending a response back to the client |
101001 |
The error code indicating an IOException error in receiving a message from a client |
101002 |
The error code indicating an HTTP protocol error in receiving a message from a client |
101003 |
The error code indicating a connection [socket] timeout reading the request from the client |
101005 |
The error code indicating a connection close [socket] reading the request from client |
101006 |
The error code indicating that a response cannot be submitted as the connection to client is already closed |