Every application that uses AMQP needs to establish a connection with the AMQP broker. By default, RabbitMQ (as well as any other AMQP broker up to version 1.0) works over TCP as a reliable transport protocol on port 5672, that is, the IANA-assigned port.
We are now going to discuss how to create the connection. In all the subsequent recipes we will refer to the connection and channel as the results of the operations presented here.
To use this recipe we need to set up the Java development environment as mentioned in the Introduction section.
In order to create a Java client that connects to the RabbitMQ broker, you need to perform the following steps: