Inbound HTTP component
The Inbound HTTP component is able to receive messages through HTTP requests. It will act like a webservice that listens for HTTP requests. Once a message is received, it's content will be handed to the next component in the flow.
Configuration
The Inbound HTTP component has the following configuration options:
Endpoint
Description
A URL to identify this component's endpoint.
Remarks
- The
Endpoint
name can only contain letters, numbers and these special characters:@
,.
,_
,+
,~
,?
. - The
Endpoint
name should contain between 3 and 50 characters.
Protocol
Options
http
https
(default)
Description
Select which protocol will be used to by the web service.
Tenant part
Options
Tenant ID
(default)Tenant name
Description
Select which part of the tenant is used in the URL.
Match prefix?
Options
Yes
No
(default)
Description
Whether you want use the URL of the endpoint as a prefix. See Reaching the webservice with wildcards for more info.
Preserve HTTP headers
Options
Yes
No
(default)
Description
Whether you want to keep the Camel HTTP headers on the exchange instead of removing them from the exchange.
Exchange pattern
Options
One way
Request reply
(default)
Description
This option determines how the component handles the incoming messages. By default
it Request reply
is selected. This means that the component will reply to a
incoming message with the result of the flow for that incoming message.
When you don't need the result of the flow for the message you sent, then you can
select One way
as exchange pattern. When the component receives your message it
will respond with status 200 OK
and with the body you sent.
See Behavior of the component for more information.
Remarks
- For
Request reply
the timeout option of the flow may need to be increased when the flow takes some time to process the incoming messages. - The response to the caller will be the existing Exchange body before reaching the first
One way
component in the flow. - When there is an Outbound flow link component
somewhere in the flow you should be cautious with selecting
Request reply
when the Outbound flow link hasOne way
selected for its exchange pattern option. There could be some timeouts because the Inbound HTTP component will keep waiting till it receives the processed message to sent back to the caller.
Remarks
- An Inbound HTTP component should always be the first component in the flow.
Reaching the webservice
HTTP
An Inbound HTTP with the following settings:
- Endpoint named
dovetail_test
, - Protocol set to
http
, - Tenant part set to
Tenant ID
Will have a webservice URL that looks like this (tenant id varies):
http://[host name]:9000/584936/dovetail_test
HTTPS
An Inbound HTTP with the following settings:
- Endpoint named
dovetail_test
- Protocol set to
https
- Tenant part set to
Tenant name
Will have a webservice URL that looks like this (tenant name varies):
https://[host name]/inbound_http/test/dovetail/dovetail_test
Remark
The old format of the HTTPS URL's is still supported, but just now shown in the UI. The URL above will look like this in the old format:
https://[host name]:[port]/dovetail/dovetail_test
The port
is 8001
for Test and 9001
for production.
Reaching the webservice with wildcards
By default the webservice will only match the exact URL that is specified in the
Endpoint property. In the examples above it is only
possible to reach the webservice by sending messages to the exact
/dovetail/dovetail_test
URL. If you also want to reach the same webservice with
/dovetail/dovetail_test/user
you can set the
Match prefix? property to Yes
. This way
/dovetail/dovetail_test
is the prefix for your webservice and it can
be reached with messages that use different URL's. You can get the URL of the
exchange using the header called CamelHttpUri
. Which is available on the
exchange when the Preserve HTTP Headers option
is set to Yes
.
Testing the webservice
You can use a REST client, such as POSTMAN, to send messages to the Inbound HTTP component in Dovetail. This makes it possible to manually send test data to the flow.
To send messages you wil need to:
- Enter the URL of the webservice as described above.
- Set the dropdown to
POST
- Choose message format
RAW
- Paste a message body (e.g. XML data) in the text area field.
- Click
Send
to submit the message
If you want to see if the message has been processed succesfully by Dovetail, you
can open the respective flow in the Flow Manager and go the Logging
section.
Behavior of the component
The Inbound HTTP Component will by default always send back the result of the flow,
even when the flow is asynchronous. This is determined by the
exchange pattern which is Request reply
by
default. In the following diagram it is visually explained:
In some cases this is not desired, depending on the size and complexity of the
flow it can take some time until the Inbound HTTP Component gets back a result
from the flow. Some clients like POSTMAN wait till
they get a response, but other clients or applications don't wait long enough
and get a timeout. If you always want to get back a response immediately you can
set the exchange pattern to One way
. The response
will be of status 200 OK
and the the body that was sent will also be sent back.
Remarks
- The maximum size of a message body that can be uploaded is 10 MB.