Sunday, May 25, 2014

WSO2 Message Broker 2.2.0 - An Overview of Newest WSO2 MB Release

After months of hard work we, WSO2 Message Broker team finally completed and released the version 2.2.0 of WSO2 MB, with several community demanded new features and improvements.

The release was initially planned to be go out with two main features namely Dead Letter Channel and Publisher Flow Control. However as the time goes we were able to introduce several more features listed as Cassandra and Zookeeper Profiles support with MB, Message Selectors and Dynamic Queue Support as well as improved SSL and Failover support and a lot more. Below is a quick overview of the newly released WSO2 MB 2.2.0 version. 

The complete information can be found in MB 2.2.0 official documentation which describes each of below feature in detail.

WS02 MB 2.2.0 New Admin Console

What comes new ???

First let's download WSO2 MB 2.2.0 version to experience the new features. Now we are ready go through the list  :)

๏ Dead Letter Channel implementation
The Dead Letter Channel (DLC) is specifically designed to persist messages that are faulty or rejected by the message receivers, providing you with a choice on whether to delete, retrieve or reroute the messages from the DLC. If the subscriber rejected the message, did not ack the sever within a configured time or could not receive message due to connection fail first MB erver will try to resend the message.After doing this for a maximum number of configured times  the message will be routed to DLC.

A user can perform following actions on DLC messages
  • Delete (discard mal-formatted message)
  • Restore message to the original queue 
  • Re-route the message to any other existing queue in MB cluster

๏ Publisher Flow control implementation
Flow control ensures that the rate at which messages are transmitted from the publisher to the receiver is controlled. Back-pressure is exerted when the defined global memory threshold or message count threshold per connection is exceeded. At this point, message acceptance is blocked until the sender is notified of memory recovery.  If the memory is not recovered within a specified time interval 'qpid.flow_control_wait_failure' which is by default 120s (2 mins), all currently publishing clients will be disconnected. But the subscriber clients will be able to continue.
The users are able to increase/decrease this wait time as needed by setting system property 'qpid.flow_control_wait_failure' at client-side. This value is 'long' type.

WSO2 MB 2.2.0 comes with following flow control mechanisms.
1. Throttling based on global memory threshold
2. Throttling based on message count per connection

๏ MB profile support for Cassandra and Zookeeper
With the previous MB releases it was required to download Cassandra and Zookeeper from external sites and point MB to be run with those. From 2.2.0 onwards this is no longer needed and you can start WSO2 MB purely as a Apache Cassandra server. All configurations files of Cassandra are there plus the port is configurable with an offset. The logs related to Cassandra are written to wso2carbon.log file as well as we have introduced a new log file specially for Cassandra system logs, as <MB_HOME>/repository/logs/cassandra_system.log file. Cassandra tools such as nodetool,cassandra-cli scripts are also packed inside MB. Also now you can start WSO2 MB purely as a Apache Zookeeper server. Hence in order to create a complete message broker cluster the users only need a WSO2 MB distribution.

๏ JMS message selectors support
Message selectors allow you to filter specific messages using a selector string. The message consumer will then receive only messages whose headers and properties match the selector. There are different patterns that can be used in selector strings, and the broker (JMS provider) filters messages according to that query. It is not possible for a message selector to filter messages on the basis of the content of the message body.

๏ Queue/Topic Permission model 
The role permission list is modified now the admin can explicitly set the each permissions like create queue/browse queue etc. inside a role. Therefore now when you create a queue/topic it can be selected whether this user can publish/subscribe to the created queue or topic.

WSO2 MB 2.2.0 Permission Model

๏ Dynamic queue support
In previous Message Broker releases users needed to create a subscriber or create the queue from admin console before start publishing messages to that queue and if not messages will be lost. Now this is  improved with dynamic queue support that when the publisher client initiates the queue is created in the broker, even if there are no consumers. The create queue segmant of message publisher would be as follows.
        QueueConnectionFactory connFactory = (QueueConnectionFactory) ctx.lookup(CF_NAME);
        QueueConnection queueConnection = connFactory.createQueueConnection();
        QueueSession queueSession =
                queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
        // create queue
        Queue queue =  queueSession.createQueue("Queue-MB");
        // create the message producer for queue
        javax.jms.QueueSender queueSender = queueSession.createSender(queue);

๏ Improved SSL support
The wire level connection between client-server of broker can be encrypted using SSL to provide maximum protection where this is supported in both standalone and clustered mode with failover as well. The SSL properies are easily configurable at the client side using AMQP connection url.

๏ Improved logging 
Trace level logs are now separated for easy debugging. In addition there are two more log files have been introduced for Cassandra and Zookeeper profiles named, cassandra_system.log and zookeeper.log file.

๏ Queue/Topics Subscription UI
A new segmant is introdued to WSO2 MB 2.2.0 admin console as shown in above image to view active/inactive queue and topic subscriptions for whole MB cluster. The following details are displayed in the new UI.
  • View active topic subscriptions in whole MB cluster 
  • View inactive durable topic subscriptions specifically.
  • Ability to unsubscribe inactive durable topic subscriptions with UI.

Queue/Topic Subscriptions UI

Apart from these major changes there are a lot of bug fixes and improvements in the new release. It was a great and hard team work for the last few months for all of us ( there are a lot in the team including our QA crew) to finally get the 2.2.0 release out. It is really proud to be a part of my team and we are now gearing up for WSO2 MB 3.0.0 which will be coming out as a complete revamped architecture. Looking forward for 3.0.0 :) :)

[Quick Note] Modifying Git Configurations in Ubuntu and Windows

OS : Ubuntu 13.10 or Windows 7

This is a brief post on how to change default configuration entries for Git.

There might be requirements that you need to change the default username where the commits get written to github, specially if you created a new github account, changed email etc.

Git uses global configuration file called .gitconfig in order to store the global credentials. To change the default user you can simply edit this file.

isha@thinkpad:~$ vim .gitconfig

For Windows this file can be found in file: git/etc/.config location.
I have set the following three properties here.

 1. username: github username of author.
 2. user email: github email address of user.
 3. credential helper: turn on the credential helper so that Git will save your password in memory for some time. By default Git will cache your password for 15 minutes. You can change this by changing --timeout property in the command.

        name = ishadil
        email =
        helper = cache --timeout=3600  // i have changed timeout for 1 hour

Other option is doing this using the command prompt as below.

git config --global "ishadil"

git config --global ""

git config --global credential.helper 'cache --timeout=3600'

After that use git config --global --list command to verify whether the properties are reset correctly.

git config --global --list

In a similar manner there are lot more configuration entries that can be set into this file. For e.g. let's set a proxy url in to git .config file.

    proxy =