republish valid cookie

This commit is contained in:
2024-01-15 16:03:12 +01:00
parent d1ffd28b6a
commit 455997a71c
8 changed files with 244 additions and 101 deletions
+21
View File
@@ -0,0 +1,21 @@
import pika
QUEUE_HOST = "appointment.lpaconsulting.fr"
REQUEST_DATA_QUEUE = 'REQUEST_DATA'
credentials = pika.PlainCredentials('appointment', 'ZyuhJZ2xEYWhElhpJjy7YEpZGZwNYJz2fHIu')
class CookiesPublisher:
def __init__(self):
self.connection = None
self.channel = None
def set_up_connection(self):
self.connection = pika.BlockingConnection(
pika.ConnectionParameters(host=QUEUE_HOST, port=5672, credentials=credentials))
self.channel = self.connection.channel()
# self.channel.queue_declare(queue=REQUEST_DATA_QUEUE, durable=True)
def publish_body(self, body: str):
self.channel.basic_publish(exchange='', routing_key=REQUEST_DATA_QUEUE, body=body)