Wednesday, March 6, 2019

Using WAIT/Delay/Sleep in OSB Code


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.


Step 1 :- Download the JAR




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.



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 






Step 6 - Choose the Method 





Step 7 - Set the Parameters : 

Arguments int : set the delay time in milliseconds - here we are using 2 mins -> 120000 ms








23 comments:

  1. Can you please share the Jar file.

    ReplyDelete
    Replies
    1. Do you still need it ? sry i just saw your message !

      Delete
  2. I need Jar. can you please send

    ReplyDelete
    Replies
    1. https://drive.google.com/file/d/1Voc5I5Skj-QX0z1s7u-1waLVAk8vSf1q/view?usp=sharing

      Delete
  3. Lazy people.. Can't even copy code from here and build jar themselves..

    ReplyDelete
    Replies
    1. haha ! not everyone is expert in all the fields :) its always good to help ppl !

      Delete
  4. I cannot see the methods of whilethe class trying to select during java callout.. what went wrong?

    ReplyDelete
    Replies
    1. I am able to select the class, just tried. Let me upload the screenshots again !

      Delete
    2. I meant I cannot see the methods when I tried. It is showing no methods available.

      Delete
    3. Do I need to change any compiler settings?

      Delete
    4. which version of jdeveloper you are using ? do you have skype / zoom or any screensharing app ? can help you there

      Delete
    5. Same issue for me ? not able to see the class.

      Delete
  5. can u mail me the jar file to dbpeterson030@gmail.com

    ReplyDelete
  6. Rest is significant for pretty much every part of our lives - it straightforwardly influences our wellbeing and prosperity, and can mean the contrast between awakening and feeling 1,000,000 dollars, or awakening and having the entire world feel like it's against you.


    custom earplugs for sleeping

    ReplyDelete
  7. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support in this area. same as your blog i found another one Oracle OSB Training .Actually I was looking for the same information on internet for Oracle OSB and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete
  8. EPOS Technologies Limited is a developer, and seller of POS Software solutions. Our mission is to change the future of POS by offering cutting-edge products, produced in total quality control by our expert team. With passion for technological innovation and customer satisfaction we have won the hearts of numerous customers around the world.

    Online Ordering

    ReplyDelete

  9. EPOS Technologies Limited is a developer, and seller of POS Software solutions. Our mission is to change the future of POS by offering cutting-edge products, produced in total quality control by our expert team. With passion for technological innovation and customer satisfaction we have won the hearts of numerous customers around the world.
    Online ordering for restaurants
    Online ordering for takeaway
    Click & collect
    Online Ordering

    ReplyDelete
  10. You can also enter in KBC show with a single text by giving the correct answer.
    You will get 2 chances in a month for winning KBC Lucky Draw.
    You can participate in KBC Lottery winner 2021 with a single text, call or by visiting our Head office.
    https://kbconlinewinner.com

    ReplyDelete
  11. online indus is a Pakistani news channel committed to bring you up-to-the minute news stories from around Pakistan & all over the world.
    https://onlineindus.com/

    ReplyDelete
  12. KBC head office number, Kbc lottery,Kbc lottery winner 2022,
    Kbc lottery number,Kbc online lottery winner,
    Kbc lottery winner,Kbc helpline number,
    Kbc head office whatsapp number, KBC manager number,
    KBC manager name, Kbc check lottery,
    kbc manager akash verma, kbc manager rana pratap singh,

    ReplyDelete
  13. https://buyyourgoods24.blogspot.com/

    BUY YOUR GOODS is an e-commerce platform by amazon affiliation.
    You can buy your STUFF and products like beauty, personal care, kitchen products, shoes,
    electronic appliances and many more...

    ReplyDelete

Oracle OIC Email Notification Template

 Oracle HTML template for email notification <html> <body style="margin: 0px; background-color: rgb(226, 229, 232);"> ...