Creating a custom delay - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

You can use an expression to determine when to send a message using something like this

from("activemq:foo").
  delay().method("someBean", "computeDelay").
  to("activemq:bar");

then the bean would look like this:

public class SomeBean {
  public long computeDelay() { 
     long delay = 0;
     // use Java code to compute a delay value in milliseconds
     return delay;
 }
}