3
votes

I'm using Spring integration + WSO2 message broker for my project. My flow is:

Step 1. CLient call restful webservice

Step 2. Restful get infomation from client and send to request queue (via gateway)

Step 3. Activator get message from request queue, do bussiness logic then send back result to reply queue

Step 4. Restful get the result and response for client

My question is: Why WSO2 too slow?

It's took me 1-2 second to completed the flow with WSO2 for only one message. But when i change to ActiveMQ so perfomance significantly increased ( completed flow in 6 second for 1000 message)???

My configuration as below:

 <!-- WSO2 connection -->
<!--  <jee:jndi-lookup id="connectionFactory" jndi-name="qpidConnectionfactory" cache="true">
    <jee:environment>
            java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
            connectionfactory.qpidConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='tcp://localhost:5672'
    </jee:environment>
</jee:jndi-lookup>  -->

<!-- ActiveMQ connection -->
<bean name="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL">
        <value>tcp://localhost:61616</value>
    </property>
</bean> 

<!-- CB Configuration -->
<int:channel id="cbRequestChanel" ></int:channel>
<int:channel  id="cbResponseChanel"></int:channel >

 <jms:inbound-gateway 
       request-channel="cbRequestChanel" 
       request-destination-name="cbQueueRequest" 
       connection-factory="connectionFactory" />

<jms:outbound-gateway id="cbOutGateway"
    request-destination-name="cbQueueRequest"
    reply-destination-name="cbQueueResponse"
    request-channel="cbRequestChanel" 
    reply-channel="cbResponseChanel"
    connection-factory="connectionFactory" />

<int:gateway id="cbGateway" default-request-channel="cbRequestChanel" 
    default-reply-channel="cbResponseChanel"
    service-interface="com.test.gateway.ICBGateway" />

 <int:service-activator 
    input-channel="cbRequestChanel" method="receive"
    ref="cBServiceActivator">
</int:service-activator>

<bean id="cBServiceActivator" class="com.test.activator.CBServiceActivator" />
1
It's possible that the JNDI lookup you do with WSO2 to take some time. Test the WSO2 with 1000 messages just like you do with ActiveMQ and compare those execution times. Maybe only the first message (where you are actually performing the initial jndi lookup) to take more time. - Andrei Stefan
Hi Andrei Stefan, ofcourse i have done a test for 1000 message with WSO2, it still takes 1-2 second for one message (very slow). If i wait for completed 1000 message i think it could be over 1000 second. - namtn
Anyone found what can be an issue/reason of this bad performance? - Gazeciarz

1 Answers

2
votes

I've done a test with rabbitmq, acticemq, wso2 for same flow and use spring integration 2.2 .

The result as below:

WSO2: 1-2 second for 1 message

ActiveMQ: 70 second for 10.000 messages

RabbitMQ: 1 second for 10.000 messages.

I don't know why wso2 too slow. Anyway, RabbitMQ is really robust.