Friday 16 September 2011

Ant or Maven

Maven:
  • Has its own structure of project layout.
  • Maven has conventions. It knows where your source code is because you followed the convention.
  • Maven has a lifecycle which was invoked when you executed mvn install. This command told Maven to execute a series of sequential lifecycle phases until it reached the install lifecycle phase.
  • Dependency Management and Versioned artifact support.
  • Maven is a build system
Ant:
  • The definition of project layout is your responsibility.
  • Ant doesn’t have formal conventions like a common project directory structure or default behavior.
  • Ant doesn’t have a lifecycle. You have to define goals and goal dependencies. You have to attach a sequence of tasks to each goal manually.
  • Ant is a build tool.

Thursday 15 September 2011

Java Debugger - local and server applications.

Help to find the bug in local and server applications. Java Debugger is Dynamic, Controlled and Assignment based debugging tool.

Default JPDA(Java Platform Debugger Architecture)  syntax:
-Xdebug -Xrunjdwp::transport=dt_socket,server=y,suspend=n,address=1044

Steps to Debug a web application?

1) Create a war/web project using maven. 
        1.1)  mvn archetype:create -DgroupId=com.sify.maven2example -DartifactId=maven2example_webapp -DarchetypeArtifactId=maven-archetype-webapp
        1.2) edit index.jsp and put the following code in it.
                     <H1>While Loop in Jsp</H1>
                     <%
                             int n = 0;
                               out.println("Number:");
                              while(n<10){
                             out.println(" , "+ n);
                                 n++;
                          }
                     %>
2) do mvn eclipse:eclipse
3) import the project in eclipse,
4)
Now in eclipse, go to Run->Debug Configuration. Double click on "Remote Java Application", select the project, set the connection props(host: localhost, port: 1044) and then click debug.
5) open the directory in command prompt and type " MAVEN_OPTS="$MAVEN_OPTS -server -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n" mvn tomcat:run "
6) Start debug with application with-in eclipse.
 

Wednesday 14 September 2011

Continuous Integration - Hudson.

Continuous Integration System aims to improve the quality of software with less time taken and less effort.
Advantage of CI (Continuous Integration).
  • Early warning of incompatible or broken code.
  • Early warning of conflict changes.
  • Immediate unit test for all changes.
  • Immediate feedback to developers on Quality, Functionality and impact of code they are writing.
KEY FEATURE OF Continuous Integration.
  • Automate the build
  • Make the build self-testing
  • Keep the build fast
  • Everyone can see the results of the latest build
  • Automate deployment
  • Every commit to built automatically

Other Products for CI(Continuous Integration)

  • Curise Control.
  • Damage Control.
  • Zed.
  • Bamboo.

When Hudson is best in CI?

http://www.bigbeeconsultants.co.uk/blog/cruise-control-vs-hudson/

Hudson Urls: http://hudson-ci.org/


Tuesday 13 September 2011

Checklist TO ESB or NOT TO ESB

1) Integrating 3 or more services. ( cms, sms and pop3 services)
2) Will plug many more services later. ( may add sms services in feature, etc)
3) Integrating more then one protocol of services. ( example: http, jms, pop3, ftp services used by one application.)
4) Need message routing or content-based routing or service-base routing. (When state of the content change need to act in different path)
5) Need publishing service that will consume by other services. (Example weather report, Stock server)

Tuesday 6 September 2011

Core functionalities necessary in an ESB

Location transparency
    The ESB helps with decoupling the service consumer from the service provider location. The ESB provides a central platform to communicate with any application necessary without cou-pling the message sender to the message receiver.

Transport protocol conversion
    An ESB should be able to seamlessly integrate applications with different transport protocols like HTTP(S) to JMS, FTP to a file batch, and SMTP to TCP.

Message transformation
    The ESB provides functionality to transform messages from one format to the other based on open standards like XSLT and XPath

Message routing
    Determining the ultimate destination of an incoming message is an important functionality of an ESB that is categorized as message routing.

Message enhancement
    An ESB should provide functionality to add missing information based on the data in the incoming message by using message enhancement.

Security
    Authentication, authorization, and encryption functionality should be provided by an ESB for securing incoming messages to prevent malicious use of the ESB as well as securing outgoing messages to satisfy the security requirements of the service provider.

Monitoring and management
    A monitoring and management environment is necessary to configure the ESB to be high-performing and reliable and also to monitor the runtime execution of the message flows in the ESB.