Connecting php docker to mqtt docker

I am developing an application in IBM Bluemix. I am having two dockers

  1. Mqtt broker docker (https://github.com/mezz64/mqtt-broker-docker-image)

  2. Docker Garbage collector not finding anything to delete
  3. How does a Docker engine replace a hypervisor and guest OS?
  4. Executing wait-for-it.sh in python Docker container
  5. Finding Docker container processes? from host point of view
  6. Docker daemon and DNS
  7. Populating Docker containers with sensitive information using kubernetes
  8. Php apache based docker(https://github.com/tutumcloud/apache-php)

I am having a python code on my machine through which I intend to publish a message to Mqtt broker. Once published, I want the php docker to subscribe to Mqtt broker docker and display the message.

I am trying to connect to mqtt broker from php docker by giving the address of mqtt docker in php code as follows:

$mqtt = new phpMQTT("169.44.113.133",1883, "PHPMQTTTrial"); //Change client name to something unique

if(!$mqtt->connect()){
echo "failed";
    exit(1);
}
else
{
 echo "Success";
}

$topics['ferries/IOW/#'] = array("qos"=>0, "function"=>"procmsg");
$mqtt->subscribe($topics,0);

while($mqtt->proc()){

echo "hi";

}


$mqtt->close();

function procmsg($topic,$msg){
        echo "Msg Recieved: ".date("r")."\nTopic:{$topic}\n$msg\n";
}

However, it fails to connect.
Can someone guide and tell me how to go about this?

  • Using Docker for a mail server
  • How to change Docker default subnet size?
  • Dockerized web app connecting to MySQL DB on host
  • Ansible deploys Docker container to wrong Vagrant VM
  • Make Docker machine very fast
  • xmlrpc over nginx w/ scgi
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.