public void run() {
		MqttClient client;
		try {
		      client = new MqttClient(Server.MQTT_ADDRESS, Server.MQTT_NAME);
		      client.setCallback(new MqttCallback() {
		    	  
	                @Override
	                public void connectionLost(Throwable cause) {
	                    System.out.println("Connection lost, Trying to reconnect");
	                    
	                }
	 
	                @Override
	                public void deliveryComplete(IMqttDeliveryToken token) {
	                	
	                }
	 
	                @Override
	                public void messageArrived(String topicName, MqttMessage message)
	                        throws Exception {
	                	String payload = new String(message.getPayload());
	                    System.out.println("[Received publish] " + payload);
	                    ContextItem newItem = generateContextItem(payload);
	                    
	                    if(newItem != null) {
	                    	ContextDAO.store(newItem);
	                    }
	                }
	                
	          });
		      client.connect();
		      /*client.subscribe("location");
		      client.subscribe("patientSensor");
		      client.subscribe("epr");*/
		      ArrayList<String> list = getSubscribeList();
		      if(list == null) {
		    	  System.out.println("Failed in getting subscribe list");
		    	  client.disconnect();
		    	  return;
		      }
		      Iterator<String> i = list.iterator();
		      while(i.hasNext()) {
		    	  client.subscribe(i.next());
		      }
		      
		      System.out.println("Context collector started");
		      
		} catch (Exception e) {
		      e.printStackTrace();
		}
	}