Skip to content

Please support ssl connection string #19

@TomerGershi

Description

@TomerGershi

Support ssl connection (needed for AWS RabbitMQ service)
changes needed only in rabbitmq_connection_data.py:

--- a/bunny_storm/rabbitmq_connection_data.py
+++ b/bunny_storm/rabbitmq_connection_data.py
@@ -14,6 +14,7 @@ class RabbitMQConnectionData:
     port: int = 5672
     virtual_host: str = "/"
     connection_name: str = ""
+    ssl: bool = False

     def uri(self) -> str:
         """
@@ -22,4 +23,5 @@ class RabbitMQConnectionData:
         """
         vhost = "" if self.virtual_host == "/" else self.virtual_host
         name_query = f"?name={self.connection_name}" if self.connection_name else ""
-        return f"amqp://{self.username}:{self.password}@{self.host}:{self.port}/{vhost}{name_query}"
+        header = "amqps" if self.ssl else "amqp"
+        return f"{header}://{self.username}:{self.password}@{self.host}:{self.port}/{vhost}{name_query}"

Didn't had permissions to post PR myself.

Thanks,
Tomer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions