SOA / Web Services / Java

A Technology Blog

Ruby: Reading property file

Posted by Vivek on June 10, 2015

  1. Create a yml file containing properties:

Consider the following properties file with a property

         inputfile: C:\example\myfile.xml

  1. Load the properties file using the following command:

yml = YAML::load(File.open(‘properties.yml’))

  1. Fetch the property using the following statement:

yml[‘inputfile’]

Posted in SOA | Leave a Comment »

Call for papers – Hadoop

Posted by Vivek on June 5, 2015

The call for papers is open for Strata+Hadoop World 2015 in Singapore, Dec 1-3.
If you’re up for presenting and would like to share your ideas, case studies, best practices and technical knowledge submit your presentation proposals here before the June 18th deadline

Posted in SOA | Leave a Comment »

Free Mulesoft ESB Training

Posted by Vivek on June 5, 2015

Register now !!

https://training.mulesoft.com/mulesoft_u/developer_essentials

This is an 8-week self-study course for developers, architects, and technical managers who want to achieve ‘Associate MuleSoft Developer’ certification.

Posted in SOA | Leave a Comment »

Register for the Mulesoft Forum 2015 (July 14, 2015).. Free!!

Posted by Vivek on June 5, 2015

If you are a CIO, Project Manager, an Integration Architect, or Developer, don’t miss the opportunity to engage in an interactive discussions with your peers around digital transformation. You will walk away with a number of innovative ways to improve and transform projects and business initiatives with API-led connectivity.

At MuleSoft Forum, you’ll have the opportunity to:

  • Learn how Mule ESB Enterprise Edition offers reliability, performance, scalability, security – all out-of-the box.

  • See MuleSoft’s connectivity platform in action in a short live demo

  • Discover how API-Led Connectivity enables major business initiatives

  • Attend the exclusive MuleSoft ecosystem networking reception

http://www.cvent.com/events/forum-2015-mumbai/event-summary-1684136a44bc44508de58022bc59c63c.aspx?lang=en&sms=2

Posted in SOA | Leave a Comment »

ClassNotFOundException? – Command to find the required jar

Posted by Vivek on February 2, 2015

It is irritating when one gets ClassNotFoundException. One can go and find the jar and add it to the classpath to resolve the problem. Jars can be searched on sites like http://www.findjar.com. However, sometimes jars are within the system and only thing needed to fix the problem is to set the classpath appropriately. Here is the unix command to find the jar:
$ find . -name “*.jar” -print -exec jar -tf ‘{}’ \; | grep -E “jar$|String\.class”

Posted in SOA | Tagged: | Leave a Comment »

WMB – Create and View Trace Logs

Posted by Vivek on February 2, 2015

Trace logs are important when one has to find out root cause of any problem occurred during message flow execution. This post helps you understand the commands that are required:

You can create user trace by running the following command:

Start user trace:

mqsichangetrace <brokername> -u -e <egroup> -f “<Message Flow Name>” -l debug -r -c 50000

You can stop user trace with the following command:

Stop trace:

mqsichangetrace <brokername> -u -e <egroup> -f “<Message Flow Name>” -l none

Retrieve the trace log for the specified component:

mqsireadlog <brokername> -u -e <egroup> -f -o flowtrace.xml

Format XML trace file for viewing purpose:

mqsiformatlog -i flowtrace.xml -o userflowtrace.txt

Similarly, you can create service trace by executing a series of commands:

Service Level Trace:

Start trace.

mqsichangetrace <brokername> -t -e <egroup> -l debug -r -c 100000

Stop trace.

mqsichangetrace <brokername> -t -e <egroup> -l none

Retrieve the trace log for the specified component.

mqsireadlog <brokername> -t -e <egroup> -f -o flowtrace.xml

Format the XML trace file.

mqsiformatlog -i flowtrace.xml -o serviceflowtrace.txt

The serviceflowtrace.txt will be in the current working directory

Posted in IBM Websphere Message Broker | Tagged: | Leave a Comment »

How to Stop all MQ Processes?

Posted by Vivek on October 26, 2014

1. Login as mq admin user

2. Use the endmqm command to stop all running queue managers.

endmqm {BROKERNAME}

3. Stop any listeners associated with the queue managers, using the
command:

endmqlsr -m {BROKERNAME}

4. To check that you have stopped all of them, enter the following

ps -ef | grep mq

5. Check that there are no processes listed that are running command lines beginning amq or runmq. Ignore any that start with amqi.

Posted in IBM Websphere MQ | Tagged: , | Leave a Comment »

Continous Integration Tools: Which one is the best?

Posted by Vivek on July 28, 2014

Here is a snapshot of the survey conducted by infoQ on their site to figure out which continuous integration tools is widely used and has got the desired features:

CI_Tools

 

 

Posted in SOA | Leave a Comment »

Java based integration framework

Posted by Vivek on July 8, 2014

We all know the capabilities of an ESB to enable seamless integration among hetrogeneous applications. But is it always a feasible to choose an ESB where integration is not a major challenge and where applications use common protocols? The answer is NO. Most of the companies are looking for open source options which allows them build an integration architecture using simple configuration. Two of the most commonly used frameworks are:

1. Spring Integration

  • Based on popular Spring application framework
  • Dependency Injection / Inversion of Control
  • Configured within Spring Container
  • XML / Annotation based DSL
  • Supports Spring expression language

 

2. Apache Camel

  • Apache Software Foundation project
  • Custom Container – Camel Context
  • Can be instantiated directly from Java method
  • Integration with Spring, Guice, OSGI

Posted in SOA | Tagged: , , , , | Leave a Comment »

Purge messages from queue using Groovy/ Java

Posted by Vivek on July 8, 2014

Purging messages is one of the common operations when working with queues.

MQI (Message Queue Interface) allows browsing/ reading the message by providing various calls (MQGET, MQOPEN etc) and options alongwith. Below is a sample code to traverse the messages in a queue and perform destructive read.

 

// Set the Get Message Options

int getOpenOpts1 = MQC.MQOO_INQUIRE + MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED

MQGetMessageOptions gmo1 = new MQGetMessageOptions();

gmo1.options = MQC.MQGMO_BROWSE_FIRST + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_ACCEPT_TRUNCATED_MSG;

boolean msgPresent = true

while(msgPresent){

try{  

                def getMsg1 = new MQMessage();                     

                getQ1.get(getMsg1, gmo1);

                gmo1.options = MQC.MQGMO_MSG_UNDER_CURSOR    

                getQ1.get(getMsg1, gmo1);

gmo1.options = MQC.MQGMO_BROWSE_NEXT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_ACCEPT_TRUNCATED_MSG;                        

   }

   catch(MQException e){

if (e.completionCode == 1 && e.reasonCode == MQException.MQRC_TRUNCATED_MSG_ACCEPTED)

             {

                 // Same as expected

             }

             else

             {                 

               msgPresent = false;

             }

   }          

  }

Posted in Groovy, IBM Websphere MQ, Java/J2EE | Tagged: , , | 1 Comment »