|
31 | 31 | import org.slf4j.LoggerFactory; |
32 | 32 |
|
33 | 33 | /** |
34 | | - * |
35 | 34 | * There are well-established patterns for implementing broadcasting. The Observer pattern describes |
36 | 35 | * the need to decouple observers from their subject (that is, the originator of the event) so that |
37 | 36 | * the subject can easily provide event notification to all interested observers no matter how many |
38 | 37 | * observers there are (even none). The Publish-Subscribe pattern expands upon Observer by adding |
39 | 38 | * the notion of an event channel for communicating event notifications. |
40 | | - * <p> |
41 | | - * A Publish-Subscribe Channel works like this: It has one input channel that splits into multiple |
42 | | - * output channels, one for each subscriber. When an event is published into the channel, the |
43 | | - * Publish-Subscribe Channel delivers a copy of the message to each of the output channels. Each |
| 39 | + * |
| 40 | + * <p>A Publish-Subscribe Channel works like this: It has one input channel that splits into |
| 41 | + * multiple output channels, one for each subscriber. When an event is published into the channel, |
| 42 | + * the Publish-Subscribe Channel delivers a copy of the message to each of the output channels. Each |
44 | 43 | * output end of the channel has only one subscriber, which is allowed to consume a message only |
45 | 44 | * once. In this way, each subscriber gets the message only once, and consumed copies disappear from |
46 | 45 | * their channels. |
47 | | - * <p> |
48 | | - * In this example we use Apache Camel to establish a Publish-Subscribe Channel from "direct-origin" |
49 | | - * to "mock:foo", "mock:bar" and "stream:out". |
50 | | - * |
| 46 | + * |
| 47 | + * <p>In this example we use Apache Camel to establish a Publish-Subscribe Channel from |
| 48 | + * "direct-origin" to "mock:foo", "mock:bar" and "stream:out". |
51 | 49 | */ |
52 | 50 | public class App { |
53 | 51 |
|
54 | 52 | private static final Logger LOGGER = LoggerFactory.getLogger(App.class); |
55 | 53 |
|
56 | 54 | /** |
57 | | - * Program entry point |
| 55 | + * Program entry point. |
58 | 56 | */ |
59 | 57 | public static void main(String[] args) throws Exception { |
60 | 58 | CamelContext context = new DefaultCamelContext(); |
|
0 commit comments