Friday, July 1, 2016

Enable solr indexing debug log of WSO2 servers.

Most of the WSO2 products come with the embedded registry which is stored in several types of service artifacts. Each artifact stored as a registry artifacts. Registry artifacts are stored in an underline database as a blob content.
In practical scenario WSO2 products (ESB,Governance Registry, API Manager etc) having millions of registry resources. If WSO2 product want to search specific registry resource, It should search it from the millions of records and it will huge time consuming task and it will affected to the overall product performance.
Registry indexing comes to overcome this problem in WSO2 products. It uses embedded Solr indexing to index all of registry resources.

If anybody wants to verify how the indexing done on WSO2 products, There are indexing components you can enable debug logs. To enable it open,

1. CARBON_HOME/repository/conf/log4j.properties file.

2. Add below lines to log4j.properties file.

 log4j.logger.org.wso2.carbon.registry.indexing.solr.SolrClient=DEBUG
 log4j.logger.org.wso2.carbon.registry.indexing.ResourceSubmitter=DEBUG

3. Start Server. You will see below debug log printed in console while registry resources are indexing. 


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} -  Server           :  WSO2 Governance Registry-5.1.0

[2016-07-01 13:57:14,819]  INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} -  WSO2 Carbon started in 33 sec

[2016-07-01 13:57:15,077]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Mgt Console URL  : https://10.100.1.36:9445/carbon/

[2016-07-01 13:57:15,077]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Governance Center Store Default Context : http://10.100.1.36:9765/store

[2016-07-01 13:57:15,078]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Governance Center Publisher Default Context : https://10.100.1.36:9445/publisher

[2016-07-01 13:57:25,505] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/warn.png has been submitted to the Indexing Server

[2016-07-01 13:57:25,507] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/view.gif has been submitted to the Indexing Server

[2016-07-01 13:57:25,508] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/trace.png has been submitted to the Indexing Server

[2016-07-01 13:57:25,509] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/test.gif has been submitted to the Indexing Server 

Friday, April 15, 2016

How to generate random strings or number from Jmeter

While testing soap services, most of the time we may need jmeter scripts to generate random string or numbers as a service parameters.
I had a soap service to send the name (string value) and age (integer value) contentiously and each value should not be repeatable need to be random unique values. I used Random and RandomString functions to generate these values. Following Jmeter scrips may help you to do that.

Please find the SOAP/XML RPC request which I used here.

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dat="http://ws.wso2.org/dataservice">  
   <soapenv:Header/>  
   <soapenv:Body>  
    <dat:inputOP>  
      <dat:age>${__RandomString(5,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,)}</dat:age>  
      <dat:name>${__Random(5,0123456789,)}</dat:name>  
    </dat:inputOP>  
   </soapenv:Body>  
 </soapenv:Envelope>  


It will send SOAP request as below.

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dat="http://ws.wso2.org/dataservice">  
   <soapenv:Header/>  
   <soapenv:Body>  
    <dat:inputOP>  
      <dat:age>X7NQH</dat:age>  
      <dat:name>97593961</dat:name>  
    </dat:inputOP>  
   </soapenv:Body>  
 </soapenv:Envelope>  


Friday, March 4, 2016

How to enable HTTP wirelog for non synapse products (WSO2)

As we already know in WSO2 ESB and APIM can enable wirelog for trace the synapse massages in variius situations. But if you want to see messages going inside the Governance Registry, Application Server like non synapse based products, Following wirelog prroperties can be added in to the log4j.properties file.

 log4j.logger.httpclient.wire.content=DEBUG
 log4j.logger.httpclient.wire.header=DEBUG

It will show up all https messaged going behind the server.

 



Friday, July 17, 2015

How to disable HTTP Keep-Alive connections in WSO2 ESB / API Manager


WSO2 API manager and ESB uses HTTP keep-alive connection by default. If Keep-alive connection enabled, It will be used same HTTP connection to send request and getting responses. But if you want to disable keep-alive connection, Following property need to be added into the in-sequence in proxy service or API.






Tuesday, August 13, 2013

How to connect multiple ActiveMQ Brokers to WSO2 Enterprice Service Bus

Common use case scenario is work WSO2 ESB with one broker service. But when it goes to production deployment it may need to have more than one broker service due to maintain high availability in the production system. WSO2 ESB facilitate to connect more than one ActiveMQ brokers to serve above requirement.

Common use-case :
 Multiple  Broker use-case




Following are the steps need to be taken in to configure WSO2 ESB to work with the multiple ActiveMQ brokers.

1. Configure one ActiveMQ broker with ESB instance like common use-case. Please follow my previous blog post to do that.
2. Now start another ActiveMQ instance.
3. Assume first ActiveMQ instance port is 61616, second instance port is 61617.
4. Open axis2.xml located in ESB_HOME/repository/conf/axis2/ location
5. Now you already have one JMS receiver like follows.



    6. Add another new transport receiver as follows. make sure to change "transportReceiver name". this will be second transport receiver.




    7. Now start ESB server. ESB console will prints below messages once ESB server successfully connected to the both ActiveMQ brokers.


    INFO - PassThroughHttpListener Initializing Pass-through HTTP/S Listener...
    INFO - JMSConnectionFactory JMS ConnectionFactory : myTopicConnectionFactory initialized
    INFO - JMSConnectionFactory JMS ConnectionFactory : myQueueConnectionFactory initialized
    INFO - JMSConnectionFactory JMS ConnectionFactory : default initialized
    INFO - JMSListener JMS Transport Receiver/Listener initialized...
    INFO - JMSConnectionFactory JMS ConnectionFactory : myTopicConnectionFactory initialized
    INFO - JMSConnectionFactory JMS ConnectionFactory : myQueueConnectionFactory initialized
    INFO - JMSConnectionFactory JMS ConnectionFactory : default initialized
    INFO - JMSListener JMS Transport Receiver/Listener initialized...


    8. Now you can create sample proxy service by adding both JMS listners. It will listen to both ActiveMQ broker queues.