Rabbitmq integration issue

HI ,
I am trying to use this custom activity ,

I am getting the below error while trying to run,
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable —> RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=530, text=‘NOT_ALLOWED - access to vhost ‘/’ refused for user ‘XXXXX’’, classId=10, methodId=40 at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.ConnectionOpen(String virtualHost, String capabilities, Boolean insist)

looking at the error "access to vhost ‘/’ refused for user ‘XXXXX’', classId=10, methodId=40 " , I think its due to the Virtual host that we use. our credential has access to only that virtual host. is it possible to pass the virtual host name to this activity?


Root Cause Analysis (RCA)

The error message RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable indicates your application is unable to establish a connection with the RabbitMQ server. Digging deeper, the nested exception RabbitMQ.Client.Exceptions.OperationInterruptedException reveals the specific reason:

  • Access Denied: Your application user (XXXXX) doesn’t have permission to access the default virtual host (/). This means the credentials used lack the necessary privileges for the intended virtual host.


There are two primary approaches to resolve this issue:

1. Grant Access to the Default Virtual Host:

  • If your application truly requires access to the default virtual host, you’ll need to modify RabbitMQ user permissions. This involves granting the XXXXX user appropriate access on the "/" virtual host using the RabbitMQ administration tools or management API.

2. Specify the Virtual Host Name:

  • This is the preferred approach if your application only needs access to a specific virtual host. You can configure your RabbitMQ client library to explicitly specify the virtual host name during connection establishment. Here’s a general guideline (refer to your specific client library documentation for exact syntax):
// Assuming your library uses a ConnectionFactory object
ConnectionFactory factory = new ConnectionFactory();
factory.VirtualHost = "your_virtual_host_name";

// Create connection using the configured factory
using (var connection = factory.CreateConnection()) {
  // ... your application logic using the connection ...

By specifying the virtual host name, your application will target the appropriate host where your user has the necessary permissions.

Additional Considerations

  • Security: Granting access to the default virtual host should be done with caution, especially in production environments. Consider creating dedicated users and virtual hosts for specific applications to improve security.
  • Client Library Documentation: Refer to your specific RabbitMQ client library documentation for details on how to configure virtual host names during connection creation.

By implementing one of these solutions and potentially reviewing your user permissions, you should be able to resolve the BrokerUnreachableException and establish a successful connection to RabbitMQ.

Hi @Jayabalaji_K - try to specify the virtual host when connecting to RabbitMQ in UiPath. When using the RabbitMQ activities in UiPath, such as the “RabbitMQ Consumer” or “RabbitMQ Publisher” activities, you can pass the virtual host name as a parameter in the connection string.

I am using the custom activity and it doesnt have the parameter for virtual host

Hi Abhimanyu,
I am using the custom activity mentioned in question and it doesnt have the virtual host parameter