Posted on 09-07-2008
Today we’ve thought about an ESB. We started by decomposing the whole term of Enterprise Service Bus:
Enterprise – What is an enterprise? So in my opinion an enterprise is a organisation, which creates output or an service or something like that. Service – What is an service? I think we will use here a commonly used definition: “A unit of work done by a service provider to achieve desired end results for a service consumer.” Bus – What is an Bus? A bus is a vehicle, that stops at the bus stop when there are people that like to come in or go out of the bus. So well what do we have at all? A bus, which drives in service of an enterprise. This means it might carry people from home to the company where they work (in other direction too). So this is an ESB. So what are the enterprises which offer an ESB? One of them is SAP from germany/Waldorf:
And the corresbonding time table:
😉
Posted on 05-07-2008
During my evaluation of servicemix, creating artifacts with maven fucks up. Much commands which must be known or if not, you have to look at servicemix FAQs and so on. So I eased up the use by creating a little shell script which allows me to create project directorys, ServiceUnits and ServiceAssemblies. To use the script you need Maven2.x (I’ve used version 2.0.8) because the script encapsulates all maven commands which are needed to do create the named units. So here it is:
#!/bin/sh
#
# @Copyright Steffen Rumpf <srumpf@brockhaus-gruppe.de
# @Since Fr, 14.03.2008
# @ServiceMix Version 3.2.1
#
# Script for creating working directories and SA/SU- sceletons for servicemix
# This script depends on marven, so 'mvn' runnable must be present
#
#####################################################################################
#### Start Configuration ####
blnUsingJboss=false
jbossDeployDir=deploy
servicemixDeployDir=hotdeploy
#### End Configuration ####
cd $PWD;
clear
echo
echo "Now working in: $PWD";
echo "";
echo "Note: All commands should be use from root working directory!"
echo "";
if [ "$SERVICEMIX_HOME" == "" ]
then
echo "SERVICEMIX_HOME is not set! Exiting!"
exit 1
fi
if [ $1 ]
then
if [ $1 == "-wd" ]
then
echo "#################################"
echo "# Initalising Working Directory #"
echo "#################################"
echo ""
touch pom.xml
read -p "GroupID: " groupid
echo ""
read -p "Version: " version
echo ""
read -p "Name: " name
echo ""
read -p "Url: " url
echo ""
pom="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\txsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\t<modelVersion>4.0.0</modelVersion>\n\t<groupId>$groupid</groupId>\n\t<artifactId>parent</artifactId>\n\t<version>$version</version>\n\t<packaging>pom</packaging>\n\t<name>$name</name>\n\t<url>$url</url>\n</project>"
echo -e $pom > pom.xml
exit 0;
fi
if [ $1 == "-su" ]
then
echo "#########################"
echo "# Creating Service Unit #"
echo "#########################"
echo ""
read -p "GroupID: " groupid
echo ""
read -p "ArtifactID: " artifactid
echo ""
read -p "Version: " version
echo ""
j=0;
echo "Choose servicemix archetype:"
echo "----------------------------"
for i in service-unit http-consumer http-provider jms-consumer jms-provider ftp-poller ftp-sender jsr181-annotated jsr181-wsdl-first saxon-xquery saxon-xslt eip lwcontainer bean ode camel cxf-se cxf-bc
do
echo "$j: $i"
j=`expr $j + 1`
done
read -p "Please enter a id from above: " archetype
case $archetype in
0)archetypeArtifactId='servicemix-service-unit';;
1)archetypeArtifactId='servicemix-http-consumer-service-unit';;
2)archetypeArtifactId='servicemix-http-provider-service-unit';;
3)archetypeArtifactId='servicemix-jms-consumer-service-unit';;
4)archetypeArtifactId='servicemix-jms-provider-service-unit';;
5)archetypeArtifactId='servicemix-ftp-poller-service-unit';;
6)archetypeArtifactId='servicemix-ftp-sender-service-unit';;
7)archetypeArtifactId='servicemix-jsr181-annotated-service-unit';;
8)archetypeArtifactId='servicemix-jsr181-wsdl-first-service-unit';;
9)archetypeArtifactId='servicemix-saxon-xquery-service-unit';;
10)archetypeArtifactId='servicemix-saxon-xslt-service-unit';;
11)archetypeArtifactId='servicemix-eip-service-unit';;
12)archetypeArtifactId='servicemix-lwcontainer-service-unit';;
13)archetypeArtifactId='servicemix-bean-service-unit';;
14)archetypeArtifactId='servicemix-ode-service-unit';;
15)archetypeArtifactId='servicemix-camel-service-unit';;
16)archetypeArtifactId='servicemix-cxf-se-service-unit';;
17)archetypeArtifactId='servicemix-cxf-bc-service-unit';;
*)echo 'Unkown ArtifactID please enter archetypeArtifactId by hand.'
echo "Please enter a ID from above:"
read archetypeArtifactId;
echo ""
;;
esac
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=$archetypeArtifactId -DgroupId=$groupid -DartifactId=$artifactid -Dversion=$version
exit 0;
fi
if [ $1 == "-sa" ]
then
echo "#############################"
echo "# Creating Service Assembly #"
echo "#############################"
echo ""
read -p "GroupID: " groupid
echo ""
read -p "ArtifactID: " artifactid
echo ""
read -p "Version: " version
echo ""
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-service-assembly -DgroupId=$groupid -DartifactId=$artifactid -Dversion=$version
exit 0;
fi
if [ $1 == "-dp" ]
then
echo "#####################################"
echo "# Deploying Project into ServiceMix #"
echo "#####################################"
echo ""
read -p "Should maven run first (mvn clean install)? [yes/no]: " runmvn
while [ "$runmvn" != "yes" -a "$runmvn" != "no" ]
do
read -p "Plz type yes or no! " runmvn
done
if [ $runmvn == "yes" ]
then
mvn clean install
echo "mvn finished with status: $?"
echo ""
if [ $? != 0 ]
then
exit 0
fi
fi
echo ""
echo "Please enter your SA directory"
read -p "$PWD must not be given: " sadir
if [ "$blnUsingJboss" == "true" ]
then
cp $PWD/$sadir/target/*.jar $SERVICEMIX_HOME/$jbossDeployDir
else
cp $PWD/$sadir/target/*.jar $SERVICEMIX_HOME/$servicemixDeployDir
fi
exit 0;
fi
fi
echo "Usage:"
echo "-wd creates a new working directory"
echo "-su creates a new service unit"
echo "-sa creates a new service assembly"
echo "-dp deploy the current project"
echo "-h shows this help"
There is also a tool available for workin with ServiceMix its called Cimero2 (its a plugin for Eclipse) but its in beta status and will hopefully be maintained and extended in the next time. For this plugin I’ve created some of the BindingComponents which should be used within ServiceMix here you can get them:
servicemix-jdbc-bc.xml used for the Spagic jdbc component (Spagic is an ServiceMix based open source ESB)
Posted on 05-07-2008
As you can see, I’ve customized my blog and created my own theme… which is not finished at all, but for the first time it will fit my requirements. Also I’ve added a plugin which enables the blog to highlight source code from different programming languages. This plugin is called wp-syntax. Here are some examples: First of all PHP:
<?php
function hello($strName) {
echo "Hello $strName";
}
?>
And a second example with a unix shell script:
#!/bin/sh
var='Hello World!'
echo $var
Posted on 04-07-2008
After playing around with some custom written webpages (by myself) and testin some content management systems (CMS) I desided to create a blog. First hit I get searchin an open source blog by google was WordPress… so here it is. Easy to install, easy to use, more I don’t need x) Maybe I will do a little bit customization, create my own theme and so on… we will see and may be I will write some bloggings down here so everyone can read what I’am doing xD