Using WAIT/Delay/Sleep in OSB Code
In Oracle Service Bus 12C, wait activity is not supported by and hence we will be using a piece of java code , which will be basically make the thread to sleep for certain milliseconds passed to the method.
Piece of Java Callout :
********************
Will attach the link to the JAR file that you need to import in your Jdev / Please comment in case you need it.
********************
package threadsleep;
public class Threadsleep {
public static String sleepthreadmilis(int timer){
try{
Thread.sleep(timer);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
return "Success";
}
public static void main(String args[]) {
String a="Call the method for testing";
a=sleepthreadmilis(2000);
System.out.println(a) ;
}
}
Step 2 : Import the JAR
Now i will be using it in my OSB project using java callout.
Copy and paste the JAR file in any of your project folder.
Copy and paste the JAR file in any of your project folder.
Step 3 : Refresh the Artifacts in Jdeveloper :
Step 4 : Add Java callout activity in the pipeline.
**Have upload new jar (earlier it was threadsleepjar now it is archive1 )
Step 5 : Choose the Jar File