@Override
    public void publishArrived(String topic, byte[] message, int qos, boolean retain) {
        try {
            Cbor cbor = new Cbor(message);
            Bytes bytes = new Bytes(message);
            String value = cbor.toString();
            cbor.offset(0);
            Cbor.Token token = cbor.readToken();
            if (token.type == Cbor.CborType.C_FLOAT) {
                value = Float.toString(token._float);
            } else if (token.type == Cbor.CborType.C_PINT) {
                value = Long.toString(token._long);
            } else if (token.type == Cbor.CborType.C_BOOL) {
                value = Boolean.toString(token._bool);
            } else if (token.type == Cbor.CborType.C_STRING) {
                value = token.str;
            }else if (token.type == Cbor.CborType.C_BYTES) {
                value = token.str;
            }

            logger.info(topic + " = " + value );
//            logger.info(" CBOR hex : " + bytes.toString() + " JSON : " + cbor.toString());
            //           System.out.println(" TOPIC=" + topic + " MESSAGE=" + value + " QOS=" + qos + " RETAIN=" + retain);
            /* Map<String, Object> stats = new HashMap();
             stats.put(topic, f);
             GraphiteLogger graphiteLogger = new GraphiteLogger();
             graphiteLogger.setGraphiteHost("pcpavilion.local");
             graphiteLogger.setGraphitePort(2004);
             graphiteLogger.logToGraphite("carbon.agents.pcpavilion-a", stats);*/
        } catch (Exception e) {
            logger.error("initMqtt", e);
        }
    }