June 25, 2012

JMS Configuration in Spring's ApplicationContext

Recently I faced some issue to configure JMS queue in Spring's application context. This queue is exposed on Sonic ESB and I have to connect to it using Apache Camel. First I wrote 
a JMS Producer class which puts message on client's sonic JMS queue. It was something like this:
Hashtable properties = new Hashtable();

properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.test.factory");
properties.put("com.domain", "DevelopmentDomain");
properties.put(Context.PROVIDER_URL, "tcp://");
properties.put(Context.SECURITY_PRINCIPAL, "aaa");
properties.put(Context.SECURITY_CREDENTIALS, "aaa");

javax.naming.Context context = new javax.naming.InitialContext(properties);
ConnectionFactory factory = (ConnectionFactory) context.lookup("ImpactPocQueueConnectionFactory");

Connection connection = factory.createConnection();


Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Destination queue = session.createQueue("test.producer");
Now above JMS queue setup in applicationContext xml using Camel route.Here I am routing message to sonic queue through a seda queue.





June 5, 2012

Fasting from Facebook : A food for Focus

I am behind of my schedule and loosing my focus now. List of my procrastination goes like this:

  • 3 Blog posts are pending from last 8 days. 
  • Revision of iOS programming is piling up and and reached to 5 chapters.
  • Didn't read Apache Camel from last 10 days.
  • Morning meditation reduced to 2 min from 5-7min.
  • Workout schedule reduced to 2 days in a week
On the positive side, I am still able to keep my daily routine of office timings and food. Latest life crisis has been a major distraction for my schedule. Here key will be to get my focus back as soon as possible after this crisis. 
To keep reminding myself that I have to get my focus back, I will not be using Facebook for 48 hours. Whenever I will tempt to do it, I will tell myself that I have to get my routine (focus) back.
There are few more projects/initiatives/habits coming up into my mind. I should make a list of it and prioritize them before I loose these thoughts.

May 21, 2012

List of HTML 5 features

Learning HTML 5 is in my wishlist from last two years. Whenever I start with any tutorial or blog , I get lost into all the new features. It confuses me with how much did I learn and how many features are remaining.
So here is the latest and almost full list of all the cool HTML 5 features. It provides a holistic picture of HTML5 features. 

  • Storage Features:
    1. Web Storage
    2. Web SQL Database
    3. Indexed DB
    4. Application Cache
  • Real Time/Communication
    1. Web-Workers
    2. Web-Socket
    3. Notifications
  • File/Hardware Access
    1. Native drag and drop
    2. Desktop drag-In/Out
    3. File System API
    4. Geo-location API
    5. Device Orientation
    6. Speech Input
  • Semantics & Markup
    1. Better Semantics Tags
    2. Markup for Applications
    3. Descriptive Link Relations
    4. Microdata
    5. ARIA Attribute
    6. New Form type
    7. Mobile Form Field Types
  • Graphics & Multimedia
    1. Audio/Video Support
    2. Canvas 2D
    3. Canvas 3D
    4. Inline SVG
  • Improvements to the Core Platform
    1. getElementByClassName() attribute
    2. Finding elements by CSS synatx: document.querySelectorAll()
    3. Custom data-* attributes
    4. Element class list
    5. History API
All these features with little description and example can be found html5rocks . I didn't include any CSS3 feature because it is a separate subject and has many new features.