- changed test package name from org.baeldung to com.baeldung (#897)
- streams are added where neccessary - format fixes
This commit is contained in:
parent
f7dacb83d8
commit
dfd2d7a238
|
@ -11,7 +11,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<env.camel.version>2.16.1</env.camel.version>
|
<env.camel.version>2.16.1</env.camel.version>
|
||||||
<env.spring.version>4.3.4.RELEASE</env.spring.version>
|
<env.spring.version>4.3.4.RELEASE</env.spring.version>
|
||||||
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
|
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<junit.version>4.12</junit.version>
|
<junit.version>4.12</junit.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -48,7 +48,11 @@
|
||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
<version>${env.spring.version}</version>
|
<version>${env.spring.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
<version>1.7.21</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package com.baeldung.camel.file;
|
package com.baeldung.camel.file;
|
||||||
|
|
||||||
import org.apache.camel.Exchange;
|
|
||||||
import org.apache.camel.LoggingLevel;
|
import org.apache.camel.LoggingLevel;
|
||||||
import org.apache.camel.Processor;
|
|
||||||
import org.apache.camel.builder.RouteBuilder;
|
import org.apache.camel.builder.RouteBuilder;
|
||||||
|
|
||||||
public class DeadLetterChannelFileRouter extends RouteBuilder {
|
public class DeadLetterChannelFileRouter extends RouteBuilder {
|
||||||
|
@ -10,13 +8,11 @@ public class DeadLetterChannelFileRouter extends RouteBuilder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configure() throws Exception {
|
public void configure() throws Exception {
|
||||||
errorHandler(deadLetterChannel("log:dead?level=ERROR").maximumRedeliveries(3).redeliveryDelay(1000).retryAttemptedLogLevel(LoggingLevel.ERROR));
|
errorHandler(deadLetterChannel("log:dead?level=ERROR").maximumRedeliveries(3)
|
||||||
|
.redeliveryDelay(1000).retryAttemptedLogLevel(LoggingLevel.ERROR));
|
||||||
|
|
||||||
from("file://" + SOURCE_FOLDER + "?delete=true").process(new Processor() {
|
from("file://" + SOURCE_FOLDER + "?delete=true").process((exchange) -> {
|
||||||
@Override
|
throw new IllegalArgumentException("Exception thrown!");
|
||||||
public void process(Exchange exchange) throws Exception {
|
|
||||||
throw new IllegalArgumentException("Exception thrown!");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="contentBasedFileRouter" class="org.baeldung.camel.file.ContentBasedFileRouter" />
|
<bean id="contentBasedFileRouter" class="com.baeldung.camel.file.ContentBasedFileRouter" />
|
||||||
|
|
||||||
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
||||||
<routeBuilder ref="contentBasedFileRouter" />
|
<routeBuilder ref="contentBasedFileRouter" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="deadLetterChannelFileRouter" class="org.baeldung.camel.file.DeadLetterChannelFileRouter" />
|
<bean id="deadLetterChannelFileRouter" class="com.baeldung.camel.file.DeadLetterChannelFileRouter" />
|
||||||
|
|
||||||
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
||||||
<routeBuilder ref="deadLetterChannelFileRouter" />
|
<routeBuilder ref="deadLetterChannelFileRouter" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="messageTranslatorFileRouter" class="org.baeldung.camel.file.MessageTranslatorFileRouter" />
|
<bean id="messageTranslatorFileRouter" class="com.baeldung.camel.file.MessageTranslatorFileRouter" />
|
||||||
|
|
||||||
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
||||||
<routeBuilder ref="messageTranslatorFileRouter" />
|
<routeBuilder ref="messageTranslatorFileRouter" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="multicastFileRouter" class="org.baeldung.camel.file.MulticastFileRouter" />
|
<bean id="multicastFileRouter" class="com.baeldung.camel.file.MulticastFileRouter" />
|
||||||
|
|
||||||
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
||||||
<routeBuilder ref="multicastFileRouter" />
|
<routeBuilder ref="multicastFileRouter" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="splitterFileRouter" class="org.baeldung.camel.file.SplitterFileRouter" />
|
<bean id="splitterFileRouter" class="com.baeldung.camel.file.SplitterFileRouter" />
|
||||||
|
|
||||||
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
<camelContext xmlns="http://camel.apache.org/schema/spring">
|
||||||
<routeBuilder ref="splitterFileRouter" />
|
<routeBuilder ref="splitterFileRouter" />
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.file.processor;
|
package com.apache.camel.file.processor;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.apache.camel.main;
|
package com.apache.camel.main;
|
||||||
|
|
||||||
import com.baeldung.camel.main.App;
|
import com.baeldung.camel.main.App;
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
Loading…
Reference in New Issue