Saturday, February 26, 2011

How to Access JBoss Queue with a Standalone Client

In this post I'm going to talk about how to access a JBoss queue using a standalone client. I'm not going to talk about the basic details of creating a queue that you can find in JBoss documents.

There is two steps to this
  1. Setup the JBoss queue
  2. Setup the standalone client
Lets start with the JBoss queue, lets create a normal queue

<mbean <name="jboss.messaging.destination:service=Queue, name=Queue1" code="org.jboss.jms.server.destination.QueueService">
  <attribute name="JNDIName">queue/Queue1</attribute>
  <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

Now lets setup the remote client. Make sure the JBoss necessary libraries are in the classpath.
public static Context getInitialContext( ) throws javax.naming.NamingException {
   Properties p = new Properties( );
   p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
   p.put(Context.URL_PKG_PREFIXES," org.jboss.naming:org.jnp.interfaces");
   p.put(Context.PROVIDER_URL, "jnp://");
   return new InitialContext(p);

 now lets setup the queue

    String queueName = "queue/Queue1";
    Context ic = null;
    ConnectionFactory cf = null;
    Connection connection =  null;
    QueueSession queueSession;

    connectionFactory = (ConnectionFactory) ctx.lookup("/ConnectionFactory");
    conn = connectionFactory.createQueueConnection();

    queueSession = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    queue = (Queue) ctx.lookup(queueName);
    MessageProducer queuePublisher = queueSession.createProducer(queue);

You can change the JNDI name of connection factory or you can create your own.

Now lets setup a listener.
    MessageConsumer consumer = queueSession.createConsumer(queue);

You can test the connection by sending simple message
TextMessage message = queueSession.createTextMessage("Hello Sourabh Girdhar");

To receive messages you will need to implement MessageListener interface and override the onMessage()  
public void onMessage(Message msg) {
 TextMessage message = (TextMessage) msg;
 String text = null;
  text = message.getText();
  System.out.println("Message received - " + text);
 }catch (JMSException jme){


Wednesday, February 2, 2011

Harnessing Developer Communities for Telco Apps

It is no secret today that one of the imperative sources of innovation in the Mobile Industry are application Developers. The innovative potential can be derived from an average high school kid to the likes of Mobiquest, all of which contribute to this rapidly growing industry. Every mobile application developer dreams of building the next cutting edge application and monetizing it. The success of a mobile application is based upon creativity and relevance to its intended audience. Furthermore the uniqueness of the application, its functionalities and time-to-market add on to the foundations which contribute to its success. A major challenge for Telecom operators therefore is to channel the creation of these applications that monetizes network assets and accelerating the roll out of “Telco Apps” which undoubtedly adds value to their service offering. This creates a need for telecom operators to have a platform that can entice innovation starting from idea generation, necessary tools, best practices and also a test bed where application developers can endeavor their brainchild with utmost freedom.

Enticing Developers

According to Mobile Developer Economics 2010, a study by Vision Mobile, 75% of surveyed Developers opted for Market Penetration as the most important reason to choose a Developer platform against any of its favorable technical aspects. Compared to the makers of mobile devices or mobile operating systems, few operators have a “global blanket reach” but most of them possess the advantage of strong brands in their local markets, the ability to steer traffic via network capabilities and a great deal of local knowledge of subscribers enabling “targeted reach”. We believe this is a great opportunity to inspire developers based around their localities to come up with applications suited to their surroundings. The diversity of the market could play as much a role in attracting developers. It cannot be denied that device vendor apps and the mobile web have brought out a rich wave of sophistication enhancing user experience. However this doesn’t utilize the potential of reaching out to the diversity of the masses that GSM coverage has enabled today. Operators should exploit the advantages of its network capabilities with channels such as SMS made available on every mobile handset and it is one that nearly every mobile user understands how to use. This potential materializing should spark the possibility of apps serving various spectrums of a market and operators will therefore have the unique strength to attract low to very high-end application developers.
The convergence of technologies that operators are engaged with today provides multiple interfaces for developers to reach out to their audiences via bundling, packaging, cross-product opportunities, location based services, segmentation and profiling capabilities amongst a few. The operator therefore becomes a unique and powerful channel to collaborate with, in providing applications. Pricing and charging are underlying drivers influencing the ambitions of applications. Developers of established application platforms have long been stuck with rigid pricing variants of the pay-per-download revenue model. The operator has the opportunity to provide an application its due flexibility with numerous options such as fixed price, recurring fee on usage, subscription based etc

Easing the Developer Task

Of course the proof of the pudding is in the eating of it and the platform that operators provide have to be technically sound for what developers do best – to develop applications. The Vision Mobile report goes on to say that the learning curve of the Symbian Platform and the Anrdoid Platform is approximately 15months and 6 months respectively. This is a great opportunity for operators to exploit, provide a platform that reduces the learning curve significantly. Mobile application developers who thrive to unleash their creativity in the form of novel applications crave for a simple and streamlined application development process. They want to create applications with minimal intervention and understanding of the need to connect to the telecom operator’s backend, as well as their underlying protocols. Operator platforms aiming for “developer-friendliness” will be successful in harnessing abundant creative talent amongst those who possess ground-breaking ideas but are inhibited by the technical obstacles involved in materializing these ideas. In addition to “developer-friendliness” imperatives, the availability of useful resources that enhance the applications during the development process in the form of sample applications, development tool kits and guides will help inspire budding developers and boost the development process from rapid creation, deployment and commercialization of their mobile applications.

Marketing of Telco Apps.

Market Penetration was earlier highlighted as a key factor for Developers choosing platforms and this is exemplified by Operators being able to facilitate multiple interfaces when delivering applications to subscribers. Operator’s capabilities in providing the “Telco App store” as a web based, USSD Interface appeal to a larger and a more diverse audience rather than those only having smart phones. The power of identity management options such as user profiling information coupled with network capabilities such as location provides the opportunity for developers to customize apps for distinct subscriber segments. The Vision Mobile report highlights the key challenge Developers face is, marketing their own applications. There can be various reasons for this especially if the developer and his target audiences are geographically disconnected. With operators having There is now a better opportunity for developers to do so around their own communities and interest groups especially if they have deployed the app based on the area where they are present.

Birth of a Vibrant Telco Developer Community

In a day and age where mash-ups are enriching consumer experience, the best-of-breed mobile applications are sometimes born out of collaborative ideas from many people from all walks of life. Fierce competition has led individual developers to be on the lookout for partnerships with larger communities of developers that can bring out better applications. This can be enabled with interactive online forums that are supported by technical counseling, developer workshops & networking sessions for idea generation, knowledge sharing & potential business partnerships, thus creating a vibrant developer community.

hSenid Mobile recently launched its state of the art Cloud Enabled Telco Developer Portal that is set to pave the way for a vibrant Developer Community with a simplified Development Path resulting in a Plethora of “Telco” Applications for Mobile Operators to provide its diverse subscriber base.

Tuesday, February 1, 2011

Telco based SMS and MMS application using JAVA and .NET

AppZone is the Worlds first ever Telco based mobile application appstore launched by Etisalat Sri Lanka partnered with hSenid Mobile. This platform allows the users to browse the mobile applications and also gives the opportunity for application developers to create, test and sell their own unique applications.
It helps developers to create application using Java , .NET or any other programming language (which supports HTTP) they prefer, to send a receive SMS and MMS to mobile phones. Which gives the opportunity for developers to get recursive revenue which is not available in downloadable application for mobile handsets.

Sample Code
public class SimpleSmsMt {
public static void main(String[] args) {
      try {
MchoiceAventuraSmsSender sender = new MchoiceAventuraSmsSender(new
                                                                    URL("http://appzone.server:8899/"), "SMS_6063",
// send message to a single destination
String message = "hi im jason";
String address = "+94969696969";
sender.sendMessage(message, address);
} catch (Throwable e) {

Use the API's to create your applications and services. The downloads you need are here, as well as the documentation and the community to speed things up.

    If you have created the application its easy as to drop a mail to go live.
    Drop a mail to to get your account details or if you want any clarification.