The Throw Exception EIP throws exceptions during message processing, offering greater control over the integration flow. With it, you can interrupt execution in specific scenarios, handle failures in a customized way, and ensure the expected behavior of processes.
When throwing an exception with Throw Exception, the integration flow is immediately interrupted, and the following steps stop being executed until the exception is handled or caught.
All exceptions generated by this component are recorded in the Analytics logs, allowing the user to easily monitor errors and failures that occurred during flow execution.
To configure a Throw Exception in an integration in the Diagram tab, follow these steps:
Click +Add Step on the canvas.
Select the EIPs tab.
Select the Throw Exception EIP. You can use the search tool to locate it.
Fill in the following fields:
Message: custom message that will be associated with the exception.
Exception Type: specific type of exception to be thrown.
Check frequently used exceptions:
Exception Type | Description |
|---|---|
| java.lang.IllegalArgumentException | Invalid parameter |
| java.lang.NullPointerException | Unexpected null value |
| java.lang.RuntimeException | Generic runtime exception |
| java.io.IOException | IO problems, such as file or network failure |
| javax.validation.ValidationException | Data validation failure |
| java.lang.UnsupportedOperationException | Unsupported operation |
Check below an example of configuring the Throw Exception EIP:

The flow is initiated by a GET request.
The first step in the flow logs a message: "Starting the flow. An exception will be thrown now." This serves as a monitoring point to indicate that the flow has been started and an exception will be thrown next.
The throw-exception EIP is triggered, and an IllegalArgumentException type exception is thrown, with the message: "Exception intentionally thrown by the throw-exception EIP".
In practice, the client will receive an HTTP error (probably 500 Internal Server Error) with the exception message, depending on your runtime configuration.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more