SCENARIO:
Sunday, February 21, 2010
Convert the SOAP message to a plain text mail
SCENARIO:
Tuesday, February 2, 2010
WSO2 Enterprise Service Bus 2.1.3 Released!
The WSO2 ESB team is pleased to announce the release of version 2.1.3 of the Open Source Enterprise Service Bus (ESB). This is an enhanced and improved release of the WSO2 ESB 2.1.2 which went out on November 2009.
WSO2 ESB is a lightweight and easy-to-use Open Source Enterprise Service Bus (ESB) available under the Apache Software License v2.0. WSO2 ESB allows administrators to simply and easily configure message routing, intermediation, transformation, logging, task scheduling, load balancing, failover routing, event brokering, etc.. The runtime has been designed to be completely asynchronous, non-blocking and streaming based on the Apache Synapse core.
WSO2 ESB 2.1.3 is developed on top of the revolutionary Carbon platform (Middleware a' la carte), and is based on the OSGi framework to achieve the better modularity for your SOA architecture. This also contains a lots of new features and many other optional components to customize the behavior of the server. Further, if you do not want any of the built in features, you can uninstall those features without any trouble. In other words, this ESB can be customized to your SOA needs.
You can download this distribution from http://wso2.org/downloads/esb and give it a try.
How to Run
- Extract the downloaded zip
- Go to the bin directory in the extracted folder
- Run the wso2server.sh or wso2server.bat as appropriate
- Point your browser to the URL https://localhost:9443/carbon
- Use "admin", "admin" as the username and password to login as an admin and create a user account
- Assign the required permissions to the user through a role
- If you need to start the OSGi console with the server use the property -DosgiConsole when starting the server. The INSTALL.txt file found on the installation directory will give you a comprehensive set of options and properties that can be passed into the startup script
- Samples configurations can be started by the wso2esb-samples script passing the sample number with the -sn option, please have a look at the samples guide for more information, on running samples
New Features of WSO2 ESB 2.1.3
- This ESB release is based on the award winning WSO2 Carbon "Middleware a' la carte", an OSGi based SOA platform, version 2.0.3 by WSO2 Inc.
- HTTP binary relaying support for ultra fast mediation via the ESB
- New mediation statistics viewer
- API for accessing mediation statistics at runtime
- Enhanced remote registry support
- Ability to edit dynamic sequences saved in the registry from the UI editor
- Rule based mediation powered by Drools
- Fine grained autherization for services via the Entitlement mediator
- Enhanced WS-Eventing support and Event Sources making it an even broker
- Enhanced AJAX based sequence, endpoint and proxy service editors
- Enhanced permission model with the user management
- Enhanced REST/GET and other HTTP method support
- P2 based OSGi provisioning support, for optional features like service management, runtime governance and so on..
- Many bug fixes, UI enhancements and usability improvements
Key Features of WSO2 ESB
- Proxy services - facilitating synchronous/asynchronous transport, interface (WSDL/Schema/Policy), message format (SOAP 1.1/1.2, POX/REST, Text, Binary), QoS (WS-Addressing/WS-Security/WS-
RM) and optimization switching (MTOM/SwA). - Non-blocking HTTP/S transports based on Apache HttpCore for ultrafast execution and support for thousands of connections at high concurreny with constant memory usage.
- Built in Registry/Repository, facilitating dynamic updating and reloading of the configuration and associated resources (e.g. XSLTs, XSD, WSDL, Policies, JS, Configurations ..)
- Easily extendable via custom Java class (mediator and command)/Spring mediators, or BSF Scripting languages (Javascript, Ruby, Groovy, etc.)
- Built in support for scheduling tasks using the Quartz scheduler.
- Load-balancing (with or without sticky sessions)/Fail-over, and clustered Throttling and Caching support
- WS-Security, WS-Reliable Messaging, Caching & Throttling configurable via (message/operation/service level) WS-Policies
- Lightweight, XML and Web services centric messaging model
- Support for industrial standards (Hessian binary web service protocol/ Financial Information eXchange protocol and optional Helth Level-7 protocol)
- Enhanced support for the VFS(File/FTP/SFTP)/JMS/Mail transports with optional TCP/UDP transports and transport switching for any of the above transports
- Support for message splitting & aggregation using the EIP and service callouts
- Database lookup & store support with DBMediators with reusable database connection pools
- WS-Eventing support with event sources and event brokering
- Rule based mediation of the messages using the Drools rule engine
- Transactions support via the JMS transport and Transaction mediator for database mediators
- Internationalized GUI management console with user/permission management for configuration development and monitoring support with statistics, configurable logging and tracing
- JMX monitoring support and JMX management capabilities like, Gracefull/Forcefull shutdown/restart
Get Involved
Help us improve this product by reporting any issues you many have: WSO2 ESB JIRA.
You can also watch how they are resolved, and comment on the progress.
Contact Us
Get in touch with the product team via the mailing lists:
- Developer List : esb-java-dev@wso2.org | Subscribe | Mail Archive
- User List : esb-java-user@wso2.org | Subscribe | Mail Archive
To subscribe to the above mailing lists see http://wso2.org/mail
Alternatively, questions can also be raised in the forum: http://wso2.org/forum/187
Support
We are committed to ensuring that your enterprise middleware deployment is completely supported from evaluation to production. Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology.
For more details and to take advantage of this unique opportunity please visit http://wso2.com/support
For more information about WSO2 ESB please see http://wso2.com/products/
Thank You!
The WSO2 ESB team
Thursday, January 21, 2010
How to apply a patch
$svn diff > ~/Desktop/carbon.patch021
2). Apply the saved patch to the source.
$patch -p 0 < ~/Desktop/carbon.patch021
3). Commit the changes.
$svn commit
Wednesday, January 20, 2010
Access JMX MBean information through RMI
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.*;
import javax.management.openmbean.CompositeData;
import java.lang.management.ManagementFactory;
import java.net.MalformedURLException;
import java.io.IOException;
import java.util.Set;
public class JmxReport {
private static final Log log = LogFactory.getLog(JmxReport.class);
public static void logJmxInfo() {
// Operating System MXBean
log.info("Operating system architecture : " + ManagementFactory.getOperatingSystemMXBean().getArch());
log.info("Available processors : " + ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors());
log.info("Operating system name : " + ManagementFactory.getOperatingSystemMXBean().getName());
log.info("System load average : " + ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage());
log.info("Operating system version : " + ManagementFactory.getOperatingSystemMXBean().getVersion());
// Memory MXBean
log.info("Heap memory usage : " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().toString());
log.info("Non-heap memory usage : " + ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().toString());
// Class loading MXBean
log.info("Loaded class count : " + ManagementFactory.getClassLoadingMXBean().getLoadedClassCount());
log.info("Total loaded class count : " + ManagementFactory.getClassLoadingMXBean().getTotalLoadedClassCount());
log.info("Unloaded class count : " + ManagementFactory.getClassLoadingMXBean().getUnloadedClassCount());
}
public static void getJmxStatisticsViaRmi() {
try {
String jmxAgentName = "org.apache.synapse";
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
JMXConnector c = JMXConnectorFactory.newJMXConnector(createConnectionURL("heshan-laptop", 1099), null/*map*/);
c.connect();
Object o = c.getMBeanServerConnection().getAttribute(new ObjectName("java.lang:type=Memory"), "HeapMemoryUsage");
CompositeData cd = (CompositeData) o;
System.out.println(cd.get("committed"));
Object object2 = c.getMBeanServerConnection().getObjectInstance(new ObjectName("org.apache.synapse:Type=Transport,ConnectorName=nio-http-listener"));
Object lastResetTime = c.getMBeanServerConnection().getAttribute(new ObjectName("org.apache.synapse:Type=Transport,ConnectorName=nio-http-listener"), "LastResetTime");
System.out.println("lastResetTime : " + lastResetTime.toString());
ObjectName objName = new ObjectName("org.apache.synapse:Type=Transport,ConnectorName=nio-http-listener");
Set set2 = mbs.queryNames(objName, null);
for (Object o2 : set2) {
log.info(" :: " + o2.toString());
}
} catch (MalformedObjectNameException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (InstanceNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (MalformedURLException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (ReflectionException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (AttributeNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (MBeanException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
private static JMXServiceURL createConnectionURL(String host, int port) throws MalformedURLException {
JMXServiceURL serviceURL = new JMXServiceURL("rmi", "", 0, "/jndi/rmi://" + host + ":" + port + "/synapse");
/* To monitor JMX info of Carbon Platform need to enable jmx port @ carbon.xml
The link is service:jmx:rmi:///jndi/rmi://10.100.1.143:9999/server
*/
return serviceURL;
}
public static void main(String args[]) {
getJmxStatisticsViaRmi();
}
}
Programmetically access JMX MBean information
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.lang.management.ManagementFactory;
public class JmxReport {
private static final Log log = LogFactory.getLog(JmxReport.class);
public static void logJmxInfo() {
// Operating System MXBean
log.info("Operating system architecture : " + ManagementFactory.getOperatingSystemMXBean().getArch() );
log.info("Available processors : " + ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors() );
log.info("Operating system name : " + ManagementFactory.getOperatingSystemMXBean().getName() );
log.info("System load average : " + ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage() );
log.info("Operating system version : " + ManagementFactory.getOperatingSystemMXBean().getVersion() );
// Memory MXBean
log.info("Heap memory usage : " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().toString() );
log.info("Non-heap memory usage : " + ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().toString() );
// Class loading MXBean
log.info("Loaded class count : " + ManagementFactory.getClassLoadingMXBean().getLoadedClassCount() );
log.info("Total loaded class count : " + ManagementFactory.getClassLoadingMXBean().getTotalLoadedClassCount() );
log.info("Unloaded class count : " + ManagementFactory.getClassLoadingMXBean().getUnloadedClassCount() );
}
public static void main(String args[]) {
logJmxInfo();
}
}
Resolving permission issue with Tomcat
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
To resolve this;
1) Check $CATALINA_HOME and $JAVA_HOME set properly.
2) Check whether the relevant files in $CATALINA_HOME/bin have necessary permissions required for execution.
$ chmod u+x catalina.sh
$ chmod +x ./setclasspath.sh
$ chmod +x ./startup.sh
$ chmod +x ./shutdown.sh
Thursday, December 10, 2009
My 500LKR haircut
After Pandula's comment I was a bit embarrassed and thought of going to a better Saloon. After going in I told the barber the way in which I need my hair to be trimmed. He did it. At the end of the haircut I asked the barber how much is for the haircut. He said 150/=. I thought "Somebody have to pay for these fancy lights and equipment" and said "ok cool". Then I told him to give me a head massage(a statement which I would regret later).
This bugger gave me a head massage for 20 minutes. Normally in my old place the barber would give it for 5 mins. I thought that this guy was having some short term memory loss in understanding time durations. After everything was done, I asked him how much for the haircut? He said 500/=. My first reaction was that I heard it wrong and I asked the same question again to get the same answer back. Then I asked "Damn.... you charged 350/= for a head massage?". Although I had 2000/= with me at that time; under any circumstance I would not pay for a haircut that much.
I told him "I am having 300/= with me right now and out of it I have to buy a dinner packet for 100/=. I can only give you 200/=." He had no other option but to accept my proposition. [IMO barber had another extreme option. He could have asked me to cut hair of the customers until he recovers my charge (just like people are asked to wash plates in "siwari", when they are unable to pay for the food that they have eaten :)). I guess he did not have faith in me - having a pair of scissors on my hand ]. Therefore I gave him 200/= and got myself out of that place. That was the last time that I would step on that place.
Ironically the Saloon's name was "Sayonara" :) meaning 'goodbye'. 'siy-oh-nah-rah' would be the best matching name that anybody could come up with, for a Saloon like that :D