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.
The Inbound HTTP component has the following configuration options:
|A URL to identify this component's endpoint|
|Select which protocol will be used to by the webservice|
|Select which part of the tenant is used in the URL|
|Whether you want use the URL of the endpoint as a prefix. See Reaching the webservice with wildcards for more info.|
|Whether you want to keep the Camel HTTP headers on the exchange instead of removing them from the exchange.|
- An Inbound HTTP component should always be the first component in the flow.
Endpointname can only contain letters, numbers and these special characters:
Endpointname should contain between 3 and 50 characters.
Reaching the webservice
When you have installed a flow with an inbound endpoint named dovetail_test and tenant part id the webservice address will be something like this (tenant id varies):
http://[public server ip address]:9000/584936/dovetail_test
When you have installed a flow with an inbound https endpoint named dovetail_test and tenant part name Dovetail the webservice address will be something like this (tenant name varies):
https://[public server ip address]:9001/dovetail/dovetail_test
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 see the URL of the exchange using the header called
will stay on the exchange if you set the
Preserve HTTP headers property to
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 always send back the result of the flow, even when the flow is asynchronous. 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 use the Wire Tap component like in the following example:
The following diagram show what this flow above does:
The first part of the flow
(Inbound HTTP -> Wire Tap -> Velocity) serves to send back a response immediately. The response body contains whatever is specified in the Velocity component. The actual processing will happen in the other part of the flow that is connected to the bottom of the Wire Tap component. This part can also be put in another flow by using the FlowLink component. This way you can reuse both parts and it looks a bit cleaner.