Add delay option
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/73af8d61 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/73af8d61 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/73af8d61 Branch: refs/heads/feature-UNOMI-117 Commit: 73af8d61a1bec97827685ab7800721447dc9b160 Parents: 34c64e2 Author: Abdelkader Midani <amid...@apache.org> Authored: Thu Aug 17 12:53:06 2017 +0200 Committer: Abdelkader Midani <amid...@apache.org> Committed: Thu Aug 17 12:53:06 2017 +0200 ---------------------------------------------------------------------- .../router/core/route/ProfileExportCollectRouteBuilder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/73af8d61/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileExportCollectRouteBuilder.java ---------------------------------------------------------------------- diff --git a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileExportCollectRouteBuilder.java b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileExportCollectRouteBuilder.java index 4b6a34e..bff0d6d 100644 --- a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileExportCollectRouteBuilder.java +++ b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/route/ProfileExportCollectRouteBuilder.java @@ -65,7 +65,11 @@ public class ProfileExportCollectRouteBuilder extends RouterAbstractRouteBuilder if ((Map<String, String>) exportConfiguration.getProperties().get("mapping") != null) { String destinationEndpoint = (String) exportConfiguration.getProperties().get("destination"); if (StringUtils.isNotBlank(destinationEndpoint) && allowedEndpoints.contains(destinationEndpoint.substring(0, destinationEndpoint.indexOf(':')))) { - ProcessorDefinition prDef = from("timer://collectProfile?fixedRate=true&period=" + (String) exportConfiguration.getProperties().get("period")) + String timerString = "timer://collectProfile?fixedRate=true&period=" + (String) exportConfiguration.getProperties().get("period"); + if ((String) exportConfiguration.getProperties().get("delay") != null) { + timerString += "&delay=" + (String) exportConfiguration.getProperties().get("delay"); + } + ProcessorDefinition prDef = from(timerString) .routeId(exportConfiguration.getItemId())// This allow identification of the route for manual start/stop .autoStartup(exportConfiguration.isActive()) .bean(collectProfileBean, "extractProfileBySegment(" + exportConfiguration.getProperties().get("segment") + ")")