Tuesday, September 08, 2020

Creating a simple oracle service bus project using Weblogic Service bus console

 Please follow the below given step for creating the Oracle service bus project using SBConsole.

1-First click on create to have your own session and your session will not be disturbed by other user.

Right click on the project and create a pipeline

Now open the project on console

right click on project –>Open

click on the Open Message Flow as shown in the below figure

Left click on the pipeline

create a pipeline pair you will get the following screen

Now as we are doing just simple hello world example we will just modified the respose pipeline as shown below
Left click and add stage and then edit stage

click on expression

Click save.

click Save all

Thats it now click on the activate button and test the services.

Now after activate you will be able to see he excute/run button click on it and test the newly created SOAP services.

Creating a simple Service bus 12.2.1.4.0 project using integrated Oracle Jdeveloper that comes as inbuild with Oracle SOA Packages.

 Note:-

While installing SOA Quickstart to have Oracle Service bus keep below two jar in same folder and execute java -jar fmw_12.2.1.4.0_soa_quickstart.jar using administrator cmd prompt.

fmw_12.2.1.4.0_soa_quickstart.jar
fmw_12.2.1.4.0_soa_quickstart2.jar

You can download these packages from https://www.oracle.com/middleware/technologies/soasuite/downloads.html#
I am using Oracle SOA Suite 12.2.1.4.0 QuickStart
SOA installation is quite streamlined and made simple with single installer that includes JDeveloper, JDev SOA Extension, RCU, Standalone WLS and Service Bus (formerly Oracle Service Bus).

Please refer to this site for complete installation step screen wise.
https://svgonugu.com/2014/07/04/soa-suite-12c-installation/

Lets create a simple hello world SOAP project in JDeveloper using Oracle Service bus 12c [12.2.1.4.0]

Please follow the below given steps
1- Open Jedeveloper

File -> New -> Application –>Service Bus application with Service Bus Project

Click finish

This will create a simple project layout for you. Double click on SampleProjectSB it will open following screen

Now Drag HTTP Service template into proxy bucket as show below

As you can see once we click on finish button IDE also create pipeline/split for us.

Now double click the pipeline/split you will get below screen

Right click on pipeline/split and insert pipeline pair node.


Now add replace in response as shown given below

Thats it we have developed our first SOAP base Oracle Service bus example lets run the project

Right click on the project –> Run

Once you start the server you will get this screen in JEdeveloper

Click on execute button

AS shown above you will be able to see the hello world as repsonse that we set in Stage response.

You can also execute the same from the /sbconsole of the Weblogic server

http://localhost:7101/servicebus/faces/login

After login

Cick on run button on our project console as shown below and you will be able to run the project on Service bus console.

Tuesday, August 25, 2020

Simple Spring Webflux example with MongoDB

 To have full use of reactive behaviour using spring Webflux we should think of complete pipeline as reactive not just our controller part. In application, we have UI, and then we have Middle ware i.e. controller, Service Layer and DAO and finally to DB. WE want all this unit to be reactive. Struggle comes in for DB. We have generally two type of DB SQL and NOSQL. Currently, for NOSQL database we have reactive driver i.e. Cassandra, MongoDb. Bur we are shortage of same for SQL database i.e.

Oracle:-
AoJ: ADBA over JDBC:-
ADBA is Asynchronous Database Access, a non-blocking database access api that Oracle is proposing as a Java standard.
https://github.com/oracle/oracle-db-examples/tree/master/java/AoJ

MongoDB:-
MYSQL:-
https://github.com/jasync-sql/jasync-sql
jasync-sql is a Simple, Netty based, asynchronous, performant and reliable database drivers for PostgreSQL and MySQL written in Kotlin
H or MSSQL Database:-
R2DBC – Reactive Relational Database Connectivity
https://github.com/r2dbc

For our example we are going to learn MongoDB NOSQL.

Lets first create the spring webflux project as shown below

Now lets try to create folder that define our framework structure for Spring Web Flux
Config:-
Here we will have three file for configuration
1- AppConfig
2- MongoConfig
3- WebFluxconfig
Controller:-
This contain our Controller class with logic.
DAO:-
This will contain interface that map with the findby method of MongoDB.
Model:-
This will contain our model class that has getter and setter along with @ID for mapping in Mongo DB field for particular document.
Service:-
This containt interface and its implementation method to act on Mongo DB.

You can find the code on following url of Github.

https://github.com/shdhumale/siddhuspringwebfluxexample

I am using Local MongoDB you can also use the MongoDb cloud.

Hit below url and see the result on the screen.
Create/insert
POST- http://localhost:8888
{
"id":1,
"name":"siddhu1",
"address":"address1",
"salary":100
}


Update-PUT http://localhost:8888/update
{
"id":1,
"name":"siddhu1 name updated",
"address":"address1",
"salary":100
}

Select- HTTP GET http://localhost:8888/

FindbyName
GET-http://localhost:8888/name/siddhu1 name updated

Note: If you are getting below error

org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type org.bson.types.ObjectId to type java.lang.Long
Make sure to convert your ID from Log to BigInteger
also create getter setter method for the same.

@Id
BigInteger id;