working project
This commit is contained in:
8
pom.xml
8
pom.xml
@@ -105,6 +105,14 @@
|
||||
</sources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Main {
|
||||
from("activemq:queue:RawMaterial")
|
||||
.enrich("direct:getPackages", new MyAggregator())
|
||||
.marshal(xmlDataFormat)
|
||||
.to("activemq:queue:materialPackage")
|
||||
.to("activemq:queue:MaterialPackage")
|
||||
.to("log:?level=INFO&showBody=true");
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import org.apache.camel.Exchange;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MyAggregator implements AggregationStrategy {
|
||||
@Override
|
||||
@@ -35,8 +37,23 @@ public class MyAggregator implements AggregationStrategy {
|
||||
p.setDimension((String) newEx.get(i).get("dimension"));
|
||||
p.setDescription((String) newEx.get(i).get("description"));
|
||||
material.getPackages().add(p);
|
||||
|
||||
//validation
|
||||
Pattern pattern = Pattern.compile("\\d\\dx\\d\\dx\\d\\d");
|
||||
Matcher matcher = pattern.matcher(p.getDimension());
|
||||
if(matcher.matches()){
|
||||
System.out.println("maczuje");
|
||||
}
|
||||
else{
|
||||
System.out.println("nieeeeeeeee");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Exchange result = oldExchange;
|
||||
result.getIn().setBody(material);
|
||||
return result;
|
||||
|
||||
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
|
||||
See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
|
||||
Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
Generated on: 2021.11.18 at 01:43:47 PM CET
|
||||
Generated on: 2021.11.18 at 02:34:17 PM CET
|
||||
|
||||
-->
|
||||
<jaxb:bindings scd="x-schema::">
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
|
||||
See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
|
||||
Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
Generated on: 2021.11.18 at 01:43:47 PM CET
|
||||
Generated on: 2021.11.18 at 02:34:17 PM CET
|
||||
|
||||
-->
|
||||
<jaxb:bindings scd="x-schema::">
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
|
||||
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2021.11.18 at 01:43:47 PM CET
|
||||
// Generated on: 2021.11.18 at 02:34:17 PM CET
|
||||
//
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
|
||||
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2021.11.18 at 01:43:47 PM CET
|
||||
// Generated on: 2021.11.18 at 02:34:17 PM CET
|
||||
//
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
|
||||
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2021.11.18 at 01:43:47 PM CET
|
||||
// Generated on: 2021.11.18 at 02:34:17 PM CET
|
||||
//
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
|
||||
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2021.11.18 at 01:43:47 PM CET
|
||||
// Generated on: 2021.11.18 at 02:34:17 PM CET
|
||||
//
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#Generated by Maven
|
||||
#Thu Nov 18 13:46:31 CET 2021
|
||||
groupId=org.example
|
||||
artifactId=Camel
|
||||
version=1.0-SNAPSHOT
|
||||
@@ -1,4 +0,0 @@
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/DAO.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/MyBuilder.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/MyAggregator.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/Main.java
|
||||
@@ -1,8 +0,0 @@
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/DAO.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/target/generated-sources/jaxb/generated/MaterialType.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/target/generated-sources/jaxb/generated/Package.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/MyBuilder.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/target/generated-sources/jaxb/generated/ObjectFactory.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/target/generated-sources/jaxb/generated/MaterialTypeType.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/MyAggregator.java
|
||||
/home/igor/Documents/Jacek/jacek-and-igor/src/main/java/com/release11/Main.java
|
||||
Reference in New Issue
Block a user