diff --git a/camel/pom.xml b/camel/pom.xml index 048dd98..7cf3b3d 100644 --- a/camel/pom.xml +++ b/camel/pom.xml @@ -77,6 +77,11 @@ + + org.apache.camel + camel-file + 3.14.7 + org.apache.camel camel-kafka diff --git a/camel/src/main/java/com/github/theprez/manzan/configuration/DestinationConfig.java b/camel/src/main/java/com/github/theprez/manzan/configuration/DestinationConfig.java index 6fce45b..4155849 100644 --- a/camel/src/main/java/com/github/theprez/manzan/configuration/DestinationConfig.java +++ b/camel/src/main/java/com/github/theprez/manzan/configuration/DestinationConfig.java @@ -15,6 +15,7 @@ import com.github.theprez.jcmdutils.StringUtils; import com.github.theprez.manzan.routes.ManzanRoute; import com.github.theprez.manzan.routes.dest.EmailDestination; +import com.github.theprez.manzan.routes.dest.FileDestination; import com.github.theprez.manzan.routes.dest.FluentDDestination; import com.github.theprez.manzan.routes.dest.HttpDestination; import com.github.theprez.manzan.routes.dest.KafkaDestination; @@ -64,6 +65,10 @@ public synchronized Map getRoutes(CamelContext context) { final String topic = getRequiredString(name, "topic"); ret.put(name, new KafkaDestination(name, topic, format, getUriAndHeaderParameters(name, sectionObj, "topic"))); break; + case "file": + final String file = getRequiredString(name, "file"); + ret.put(name, new FileDestination(name, file, format, getUriAndHeaderParameters(name, sectionObj, "file"))); + break; case "sentry": final String dsn = getRequiredString(name, "dsn"); ret.put(name, new SentryDestination(name, dsn)); diff --git a/camel/src/main/java/com/github/theprez/manzan/routes/dest/FileDestination.java b/camel/src/main/java/com/github/theprez/manzan/routes/dest/FileDestination.java new file mode 100644 index 0000000..e64548f --- /dev/null +++ b/camel/src/main/java/com/github/theprez/manzan/routes/dest/FileDestination.java @@ -0,0 +1,17 @@ +package com.github.theprez.manzan.routes.dest; + +import java.util.Map; + +import org.apache.camel.Exchange; + +import com.github.theprez.manzan.routes.ManzanGenericCamelRoute; + +public class FileDestination extends ManzanGenericCamelRoute { + public FileDestination(final String _name, final String _file, final String _format, final Map _uriParams) { + super(_name, "file", _file, _format, _uriParams, null); + } + + @Override + protected void customPostProcess(Exchange exchange) { + } +}