Showing posts with label ESB. Show all posts
Showing posts with label ESB. Show all posts

Tuesday, March 31, 2015

Invoking WSO2 ESB proxy which uses Entitlement Mediator to evaluate a XACML rule in the WSO2 Identity Server in WSO2 Stratos 1.6

In this blog, I am assuming that you have an understanding on XACML Policy Language and use of WSO2 Stratos 1.6





This it the full synapse configuration that has been used in this sample.

Tuesday, February 18, 2014

ESB performance benchmark 2014

Competition is unavoidable in this current technology world. Since 2007, WSO2 ESB team is conducting a ESB performance evolution and these evaluations are the hot topics in the current ESB market like a 100m sprint race in Olympi


Feburary 2014, Once again WSO2 ESB has been proofed and bench marked them self as leader in the ESB performance space.


In the performance race, WSO2 has evaluated the speed against number of leading open source ESBs and WSO2 ESB defeats all others like a champion!



Results of the ESB performance round 7.5 can be found in the WSO2 Library.


Monday, November 4, 2013

JMS Correlation ID in WSO2 ESB


You can retrieve original message id from the $header Synapse XPath expression and set it as the JMS_COORELATION_ID property in your message flow. That'll set as the correlation id of the underline JMS message.

<property name="JMS_COORELATION_ID" action="set" scope="axis2" expression="$header/wsa:MessageID" xmlns:wsa="http://www.w3.org/2005/08/addressing"/>

You'll need to define the Xpath appropriately to make sure that it address the both SOAP 1.1 and 1.2 messages.

Or else you can work around it in following method aslo.

1) In the request sequence we grab the message id:
 <property name="msgID" expression="get-property('MessageID')" />
2) In the response sequence we set the correlation id using:
 < roperty name="JMS_COORELATION_ID" expression="get-property('msgID')" scope="axis2" />






Thursday, August 8, 2013

JMS MessagenStore and JMS Message Processor Behavior - WSO2 ESB - Part 2

I believe that you have referred my last post that elaborates simple use case of "Message Store" and "Message Processor" of WSO2 ESB.

There can be several issues occur in Real time or mistakes made by user
Lets take it one by one!

Issue #1 - Real Time

There can be network loss in between Backend and ESB!! Or Backend can be fail in the real world situation. Nevertheless, these situations are handled by several Enterprise Integration Patterns. And also above situation can be over come with use of Message Store and Message processor. That i have already mentioned in my last post.

Issue #2 - User Error

User error is mainly occur due to lack of knowledge on concept of  "Message Store" and "Message Processor" of WSO2 ESB. As I have noticed several time, Users are making two main issues, that i have mentioned below.

Message Insertion manual in JMS Queue  -Figure 1
As figure-1 illustrated, "Message Store" and "Message Processor" are configured to persist the message and send to Backend. However, User or Client is trying to manually add a message into the give JMS Queue!! 

So lets experiment this and see!

Step 1 - Deactivate the Message Processor and Shutdown the Backend.
Step 2 - Go to you Message Broker (I am using ActiveMQ in this scenario) and try to insert message manually.

Click on "Send To" to insert message manually in ActiveMQ - Figure 3
Add your message into Message body and Click on Send in ActiveMQ - Figure 4
As a result of Step 2, you can notice that in the "JMSMessageStore_Queue"  will be having a message that we inserted now!!!  Hmmmm So far so Good!!!!

Step 3 - Start-up the Backend and Reactivate the "Message Processor" in WSO2 ESB and have a look at the Carbon Log!

What ?? something gone wrong!!!!

Step 4 - Send some messages from client and observe what is happening!!

What ??? Nothing is happening!!!! Hmmmm... Until i explain next situation.... keep on thinking.

Note - you will see the error log In WSO2 ESB 4.6.0. Nonetheless, WSO2 4.7.0 does not show any error log until you enable debug log.  However, end of the day nothing will happen!!!

Fetch the message from JMS Queue using JMS Listener  - Figure 2

Other scenario also quite interesting!! As you see in Figure 2, another different JMS Listener is trying to access the persisted message in our JMS Queue.  So what are you going to do with the message that you got from JMS Queue???? Nothing can do!!! 

Why????? So until i write my next blog keep on thinking!!!!!






Tuesday, July 30, 2013

Retry Configuration for Error Handling in Endpoint


“retryConfig” element in WSO2 ESB facilitates developer to retry the endpoint on failure of known error codes. “retryConfig” has two different extreme flavours known as “disabledErrorCodes”  and “enabledErrorCodes” to enhance user to manage known error codes on endpoint failures.


Lets take an Example based on WSO2 ESB sample 52 [1]




Above image is illustrating a simple use case of demonstrate simple load balancing among a set of endpoints use.

Given Synapse Configuration below meet above mentioned objective.



Nevertheless, system admin or developer might already know about the Error Codes [2] that occurs during the endpoint failure, In order to avoid above circumstance it is possible to use “retryConfig”.

In known Error occurring situation, “disabledErrorCodes” disables the retry only for defined error codes within the configuration. Whereas, “enabledErrorCodes” will enable the retry only for defined error codes. Furthermore, it is not possible to have both keywords at the same time for given endpoint.By default, WSO2 ESB accepts only  the “disabledErrorCodes” keyword in above mentioned situation.



Above Synapse configuration demonstrate the basic usage of “retryConfig”.


Follow the WSO2 ESB sample 52 [1] and configure the axis2servers, As per given Synapse configuration, load balancer won't retry on “server 1”s connection failure and print “COULDN'T SEND THE MESSAGE TO THE SERVER” on client side. Whereas, if “server 2”s connection failure only it will retry the other end points.

[1] http://docs.wso2.org/wiki/display/ESB470/Sample+52%3A+Sessionless+Load+Balancing+Between+3+Endpoints



Monday, July 29, 2013

JSON to XML conversion using WSO2 ESB

I am using WSO2 ESB 4.6.0 version to demonstrate this sample, simple yet powerful.

You do not need to write your own code or relay on other library to convert json to xml. Simple WSO2 esb proxy can do the conversion for you, so we will try that. 

Lets set the requirement is to use a parameter to the methods to control whether to return JSON or XML. 

Given synapse configuration below has the very basic configuration to solve this requirement.


"JsonToXmlApi" rest api has two resource in the "Test" context. "/xml/" resource will covert the incoming json payload into xml format and send that back to client. whereas,  "/json/" resource without converting which will echo back to the client.

You can test this using curl commands that have given below,