In this research, performance testing is performed between the two most popular message brokers, which commonly used in the enterprise, namely RabbitMQ and Apache Kafka in the fog computing environment. REST API is a method that implements the HTTP protocol and commonly used in the Internet of Things as a communication media between devices. Hence the performance will degrade when the amount of request is abundant and less reliable due to its synchronous communication. By using a message broker as the medium of communication between devices in fog computing, each connected device will not rely on each other and will make the message delivery more guaranteed. By reason, this research will implement a message broker for communication between devices in fog computing. Today there are many message brokers developed by various companies or communities. Choosing an unsuitable message broker can cause performance degradation, which results in a chaotic IoT system. The test results show that Apache Kafka has a higher throughput than RabbitMQ when the message size is calculable. However, when the message size is myriad, RabbitMQ is much better because the bottleneck of disk I/O usage occurred in Kafka. Nevertheless, in latency testing, RabbitMQ is always better even though the difference is not too far. This testing can also be concluded that the use of message broker in fog computing that extends the cloud computing architecture proven effective in implementing the IoT system.