Selasa, 17 Januari 2017

Java callout in OSB

Sometimes Oracle Service Bus is not sufficient to meet our requirements. To do so OSB provides Java Callout activity that is used to call java code from OSB.

In this blog, I will explain a very basic example to use Java Callout Activity.

There are some restrictions to use Java Callout activity:

  • Java code must be packaged as jar
  • The java method that will be called from OSB, must be static
Let's proceed with an example

1) Create a simple java class:

JAVA callout in OSB

2) Create jar that will contain the .class file.

3) Copy the jar file in the OSB project

4) Drag the Java Callout activity in the pipeline and configure the properties

JAVA callout in OSB


Method: Browser the jar and select the method that you want to call and click OK
Arguments: Set the value of arguments
Return: Assign the variable in which you want to get the output of the method

5) Drag the log activity and print the greeting variable

6) Run the pipeline and see the output


That's it !!

Tidak ada komentar:

Posting Komentar