The transport rules provide a means of mapping an endpoint along with some defined options (language, linked-entities, length) to a processing URL. Transport rules allow you to define a distributed deployment routing a subset of calls to different machines, balancing the load by routing high demand calls to separate machines.
The basic format of an entry is:
endpoint [tab] options [tab] URL
endpoint is any valid endpoint and may have one or more entries. Multiple rules for the same endpoint are processed in the order listed; if there is a conflict between rules, the first one processed prevails. The most specific rules should be listed first. The last rule should be general enough to match any remaining conditions. Conditions left without a valid routing will fail.
options zero or more of:
lang=a|b|c provides a list of languages for this particular rule. Zero or more entries are permitted.
* may be used to specify any languages
length > n and
length < n where length is the number of UTF-16 characters in the input string. To define a range, you need to create 2 rules, a
< rule and a
URL valid URL for transport. There is a special URL,
local:. This is used to route
/language requests to be processed inside the front end, not sent over the network at all. The recommendation is to use
local: if the worker resides on the same machine and same JVM with the frontend.
An example of multiple endpoint entries:
/entities lang=eng|spa, http://localhost:8181/rest/worker/process
/entities linkEntities=false http://localhost:8181/rest/worker/process
/entities lang=ara|eng|jpn|spa|zho http://localhost:8181/rest/worker/process
/entities * http://localhost:8181/rest/worker/process
/language * local: