title: Device subcription to topic on AWS IoT
body: <p>I was trying out AWS IoT with my Raspberry Pi using Node.js and aws-iot-device-sdk. It is connecting fine but on <code>.subscribe</code> it is not calling the callback function. and publish is not publishing. Please if you can point me in the right direction. I have also created a rule on AWS IoT where all data from <code>topic3</code> is republished to <code>topic2</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var awsIot = require('aws-iot-device-sdk');
  
  var device = awsIot.device({
      "host": "A3SXXXXXXXXXXX.iot.us-west-2.amazonaws.com",
      "port": 8883,
      "clientId": "MyClientId",
      "thingName": "MyThingName",
      "caCert": "./certs/root-CA.crt",
      "clientCert": "./certs/certificate.pem.crt",
      "privateKey": "./certs/private.pem.key"
  });
  device
    .on('connect', function() {
      console.log('connected');
      device.subscribe({'topic3':0}, function(error, result) {
     console.log(error);
        console.log(result);
      });
      device.publish('topic2', JSON.stringify({ test_data: 2}));
    });</code></pre>
  </div>
  </div>
  </p>