From a pure EIP perspective, the translator is used to transform a message within a system whereas a bridge might include transformation between different systems.
In Spring Integration the <bridge/>
implementation is simply used as a no-op component between channels.
For example, you might have a common sub-flow that starts with a channel - let's say just some small number of components culminating in an outbound adapter (e.g. FTP). You might want to re-use that sub-flow in multiple applications - you could package it up in a jar and document that it starts with, say toFTPChannel
. Now, other applications that might want to use this "component" can simply <bridge/>
their output channels to toFTPChannel
.
The bridge does nothing more than allow you to connect two channels to one another.
Another use case is in Unit/Intgration testing - for example you might bridge the final channel of an application to a QueueChannel
so the test can consume the output message and verify it's contents.