September 2019
Intermediate to advanced
668 pages
15h 59m
English
Setting up routing rules can be done in two ways; programmatically, using a Java DSL, or by configuration. Using the Java DSL to set up the routing rules programmatically can be useful in cases where the rules are stored in external storage, such as a database, or are given at runtime, for example, via a RESTful API or a message sent to the gateway. In most cases, I find it convenient to declare the routes in the configuration file, src/main/resources/application.yml.
A route is defined by the following: