There are various connection methods for business applications to access RabbitMQ instances. This section describes how to access RabbitMQ instances using Java and Python.
| Access Method | Applicable Scenario |
|---|---|
| Access within Cluster | Applications within the cluster access RabbitMQ instances through ports exposed by SVC. |
| Access Outside Cluster | Applications outside the cluster access RabbitMQ instances through ports of NodePort. Access the management portal via the appropriate instance port. |
Prerequisites
Make sure to replace <username> and <password> in the code with the actual account information for the instance.
Ensure to replace <ip> and <port> in the code with the actual access address of the instance. In the case of access from outside the cluster, there may be multiple access addresses; you can fill them all in to enhance connection reliability.
The Java access example is as follows:
For more examples on Java client, please refer to Java Client API Guide.
For the use of other clients, please refer to RabbitMQ Tutorials.