Resolves checkstyle errors for eip-* (#1069)

* Reduces checkstyle errors in eip-aggregator

* Reduces checkstyle errors in eip-message-channel

* Reduces checkstyle errors in eip-publish-subscribe

* Reduces checkstyle errors in eip-splitter

* Reduces checkstyle errors in eip-wire-tap
This commit is contained in:
Anurag Agarwal 2019-11-10 23:04:42 +05:30 committed by Ilkka Seppälä
parent f2c91eb836
commit 7c888e8886
9 changed files with 68 additions and 69 deletions

View File

@ -30,21 +30,20 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
/**
* Sometimes in enterprise systems there is a need to group incoming data in order to process it as a whole. For example
* you may need to gather offers and after defined number of offers has been received you would like to choose the one
* with the best parameters.
*
* <p>
* Aggregator allows you to merge messages based on defined criteria and parameters. It gathers original messages,
* applies aggregation strategy and upon fulfilling given criteria, releasing merged messages.
* </p>
* Sometimes in enterprise systems there is a need to group incoming data in order to process it as
* a whole. For example you may need to gather offers and after defined number of offers has been
* received you would like to choose the one with the best parameters.
*
* <p>Aggregator allows you to merge messages based on defined criteria and parameters. It gathers
* original messages, applies aggregation strategy and upon fulfilling given criteria, releasing
* merged messages.
*/
@SpringBootApplication
public class App {
/**
* Program entry point. It starts Spring Boot application and using Apache Camel it auto-configures routes.
* Program entry point. It starts Spring Boot application and using Apache Camel it
* auto-configures routes.
*
* @param args command line args
*/

View File

@ -30,16 +30,15 @@ import org.springframework.stereotype.Component;
/**
* Sample aggregator route definition.
*
* <p>
* It consumes messages out of the <i>direct:entry</i> entry point and forwards them to <i>direct:endpoint</i>.
* Route accepts messages containing String as a body, it aggregates the messages based on the settings and forwards
* them as CSV to the output chanel.
* <p>It consumes messages out of the <i>direct:entry</i> entry point and forwards them to
* <i>direct:endpoint</i>. Route accepts messages containing String as a body, it aggregates the
* messages based on the settings and forwards them as CSV to the output chanel.
*
* Settings for the aggregation are: aggregate until 3 messages are bundled or wait 2000ms before sending bundled
* messages further.
* </p>
* <p>Settings for the aggregation are: aggregate until 3 messages are bundled or wait 2000ms
* before sending bundled messages further.
*
* In this example input/output endpoints names are stored in <i>application.properties</i> file.
* <p>In this example input/output endpoints names are stored in <i>application.properties</i>
* file.
*/
@Component
public class AggregatorRoute extends RouteBuilder {
@ -48,7 +47,8 @@ public class AggregatorRoute extends RouteBuilder {
private MessageAggregationStrategy aggregator;
/**
* Configures the route
* Configures the route.
*
* @throws Exception in case of exception during configuration
*/
@Override

View File

@ -28,8 +28,8 @@ import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.springframework.stereotype.Component;
/**
* Aggregation strategy joining bodies of messages. If message is first one <i>oldMessage</i> is null. All changes are
* made on IN messages.
* Aggregation strategy joining bodies of messages. If message is first one <i>oldMessage</i> is
* null. All changes are made on IN messages.
*/
@Component
public class MessageAggregationStrategy implements AggregationStrategy {

View File

@ -30,12 +30,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* When two applications communicate with each other using a messaging system they first need to
* establish a communication channel that will carry the data. Message Channel decouples Message
* producers and consumers.
* <p>
* The sending application doesn't necessarily know what particular application will end up
*
* <p>The sending application doesn't necessarily know what particular application will end up
* retrieving it, but it can be assured that the application that retrieves the information is
* interested in that information. This is because the messaging system has different Message
* Channels for different types of information the applications want to communicate. When an
@ -44,19 +43,18 @@ import org.slf4j.LoggerFactory;
* Likewise, an application that wants to receive particular information doesn't pull info off some
* random channel; it selects what channel to get information from based on what type of information
* it wants.
* <p>
* In this example we use Apache Camel to establish two different Message Channels. The first one
* reads from standard input and delivers messages to Direct endpoint. The second Message Channel is
* established from the Direct component to console output. No actual messages are sent, only the
* established routes are printed to standard output.
*
*
* <p>In this example we use Apache Camel to establish two different Message Channels. The first
* one reads from standard input and delivers messages to Direct endpoint. The second Message
* Channel is established from the Direct component to console output. No actual messages are sent,
* only the established routes are printed to standard output.
*/
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
/**
* Program entry point
* Program entry point.
*/
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();

View File

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

View File

@ -30,23 +30,24 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
/**
* It is very common in integration systems that incoming messages consists of many items bundled together. For example
* an invoice document contains multiple invoice lines describing transaction (quantity, name of provided
* service/sold goods, price etc.). Such bundled messages may not be accepted by other systems. This is where splitter
* pattern comes in handy. It will take the whole document, split it based on given criteria and send individual
* items to the endpoint.
* It is very common in integration systems that incoming messages consists of many items bundled
* together. For example an invoice document contains multiple invoice lines describing transaction
* (quantity, name of provided service/sold goods, price etc.). Such bundled messages may not be
* accepted by other systems. This is where splitter pattern comes in handy. It will take the whole
* document, split it based on given criteria and send individual items to the endpoint.
*
* <p>
* Splitter allows you to split messages based on defined criteria. It takes original message, process it and send
* multiple parts to the output channel. It is not defined if it should keep the order of items though.
* Splitter allows you to split messages based on defined criteria. It takes original message,
* process it and send multiple parts to the output channel. It is not defined if it should keep the
* order of items though.
* </p>
*
*/
@SpringBootApplication
public class App {
/**
* Program entry point. It starts Spring Boot application and using Apache Camel it auto-configures routes.
* Program entry point. It starts Spring Boot application and using Apache Camel it
* auto-configures routes.
*
* @param args command line args
*/

View File

@ -29,19 +29,19 @@ import org.springframework.stereotype.Component;
/**
* Sample splitter route definition.
*
* <p>
* It consumes messages out of the <i>direct:entry</i> entry point and forwards them to <i>direct:endpoint</i>.
* Route accepts messages having body of array or collection of objects. Splitter component split message body and
* forwards single objects to the endpoint.
* </p>
* <p>It consumes messages out of the <i>direct:entry</i> entry point and forwards them to
* <i>direct:endpoint</i>. Route accepts messages having body of array or collection of objects.
* Splitter component split message body and forwards single objects to the endpoint.
*
* In this example input/output endpoints names are stored in <i>application.properties</i> file.
* <p>In this example input/output endpoints names are stored in <i>application.properties</i>
* file.
*/
@Component
public class SplitterRoute extends RouteBuilder {
/**
* Configures the route
* Configures the route.
*
* @throws Exception in case of exception during configuration
*/
@Override

View File

@ -30,21 +30,23 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
/**
* In most integration cases there is a need to monitor the messages flowing through the system. It is usually achieved
* by intercepting the message and redirecting it to a different location like console, filesystem or the database.
* It is important that such functionality should not modify the original message and influence the processing path.
* In most integration cases there is a need to monitor the messages flowing through the system. It
* is usually achieved by intercepting the message and redirecting it to a different location like
* console, filesystem or the database. It is important that such functionality should not modify
* the original message and influence the processing path.
*
* <p>
* Wire Tap allows you to route messages to a separate location while they are being forwarded to the ultimate
* destination. It basically consumes messages of the input channel and publishes the unmodified message to both
* output channels.
* Wire Tap allows you to route messages to a separate location while they are being forwarded to
* the ultimate destination. It basically consumes messages of the input channel and publishes the
* unmodified message to both output channels.
* </p>
*/
@SpringBootApplication
public class App {
/**
* Program entry point. It starts Spring Boot application and using Apache Camel it auto-configures routes.
* Program entry point. It starts Spring Boot application and using Apache Camel it
* auto-configures routes.
*
* @param args command line args
*/

View File

@ -29,19 +29,20 @@ import org.springframework.stereotype.Component;
/**
* Sample wire tap route definition.
*
* <p>
* It consumes messages out of the <i>direct:entry</i> entry point and forwards them to <i>direct:endpoint</i>.
* Wire Tap intercepts the message and sends it to <i>direct:wireTap</i>, which in turn forwards it to
* <p>It consumes messages out of the <i>direct:entry</i> entry point and forwards them to
* <i>direct:endpoint</i>. Wire Tap intercepts the message and sends it to <i>direct:wireTap</i>,
* which in turn forwards it to
* <i>direct:wireTapEndpoint</i>.
* </p>
*
* In this example input/output endpoints names are stored in <i>application.properties</i> file.
* <p>In this example input/output endpoints names are stored in <i>application.properties</i>
* file.
*/
@Component
public class WireTapRoute extends RouteBuilder {
/**
* Configures the route
* Configures the route.
*
* @throws Exception in case of exception during configuration
*/
@Override