Friday, June 5, 2015

As we know, we can do Oracle Service Bus development by two ways, either we can use SB Console or we can use Eclipse IDE. There are many features available in Eclipse that we don't see in SB console and one of it is Debugger. In Eclipse there is visual debugger available that helps us to debug the proxy service message flow. In this post, we see how to use Eclipse debugger and debug simple proxy service message flow. For this post, we have prepared one sample project, that contains one business service that further invokes external service and we have created a wrapper proxy service for that business service. In the message flow, we have used route node to route the message to business service and added log activity to log the request message.

OSB Eclipse Debugger Sample Project


Before we start debugging proxy service message flow, we need to ensure that server is running in debug mode. If it not then we need to restart it in debug mode, for that first open the server view by going to Window -> Show View -> Servers. This opens the server view, to restart server in debug mode, right click on the server and click on "Restart in Debug" option. Once server restart complete , you notice server state is "Debugging, Synchronized".

OSB Eclipse Debugger Server View

OSB Eclipse Debugger Start Server in Debug Mode


Next step is to add toggle breakpoints, toggle breakpoints are added in the message flow where we want to stop our flow and validate it. We add two toggle breakpoint in this flow, one for Log action and other for routing action. To add toggle breakpoint for log action, right click on Log action and choose "Toggle Breakpoint" and repeat same step for routing action.  Once done we see two toggle breakpoints in message flow as highlighted in below diagram. There is no limit, we can add as many as toggle breakpoints in your message as per need.

OSB Eclipse Debugger Add Toggle Breakkpoint


OSB Eclipse Debugger Message Flow with Toggle Breakpoint


Now we test the proxy service from Eclipse and debug the proxy service message flow. To do that right click on proxy service , click on "Run As" and choose "Run on Server" and then later click on finish to start the testing. You can also run this proxy service from SB console or SOAP UI.

OSB Eclipse Debugger Test proxy Service


Once we click on finish, below window will come, in that window choose last option "Continue in the current mode".

OSB Eclipse Debugger Choose Server Mode


This opens the Test console window and it asks you to confirm the perspective switch, confirm it and click on "remember my decision". Enter the request message and click on execute, once you click on execute, flow stops at first toggle breakpoint in the message flow and that toggle breakpoint highlighted by green arrow as shown in below diagram. You see options to toggle in , out and resume as shown in below diagram.

OSB Eclipse Debugger Proxy Testing

OSB Eclipse Debugger Options



You can also check the content of the variable during this debugging and even though we can also change the content of the variable. Once you run all toggle breakpoints , you will see response of test console.

OSB Eclipse DebuggerVariables


0 comments :

Post a Comment