talentro-commons 0.20.4__py3-none-any.whl → 0.20.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -210,7 +210,7 @@ class QueueContext(metaclass=SingletonMeta):
210
210
  def __init__(self):
211
211
  self._rabbit_mq = RabbitMQ()
212
212
  self._message_callbacks = []
213
- self._topology_config: TopologyConfig | None = None
213
+ self._topology_configs: dict[str, TopologyConfig] = {} # Store all topologies
214
214
 
215
215
  async def connect(self):
216
216
  try:
@@ -227,7 +227,8 @@ class QueueContext(metaclass=SingletonMeta):
227
227
  await self._setup_topology_with_config(topology)
228
228
 
229
229
  async def _setup_topology_with_config(self, topology_config: TopologyConfig):
230
- self._topology_config = topology_config
230
+ # Sla topology op met exchange_name als key
231
+ self._topology_configs[topology_config.exchange_name] = topology_config
231
232
 
232
233
  await self._rabbit_mq.setup_topology(
233
234
  topology_config.exchange_name,
@@ -237,15 +238,21 @@ class QueueContext(metaclass=SingletonMeta):
237
238
  retry_config=topology_config.retry_config
238
239
  )
239
240
 
240
- async def start_consuming(self, queue: str):
241
- max_retries = self._topology_config.get_max_retries(queue) if self._topology_config else 3
241
+
242
+ async def start_consuming(self, queue: str, exchange_name: str):
243
+ topology_config = self._topology_configs.get(exchange_name)
244
+
245
+ if not topology_config:
246
+ raise ValueError(f"Topology not found for exchange: {exchange_name}")
247
+
248
+ max_retries = topology_config.get_max_retries(queue)
242
249
 
243
250
  asyncio.create_task(
244
251
  self._rabbit_mq.consume(
245
- self._topology_config.exchange_name,
252
+ exchange_name,
246
253
  queue,
247
254
  self._on_new_message,
248
- dlx_name=self._topology_config.dlx_name,
255
+ dlx_name=topology_config.dlx_name,
249
256
  max_retries=max_retries
250
257
  )
251
258
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talentro-commons
3
- Version: 0.20.4
3
+ Version: 0.20.5
4
4
  Summary: This package contains all globally used code, services, models and data structures for Talentro
5
5
  License: Proprietary
6
6
  Author: Emiel van Essen
@@ -29,7 +29,7 @@ talentro/services/caching.py,sha256=mmjhXAMJ_g8D8cJqn15YqZ7ST-G5lD9MS-PmlowI7pU,
29
29
  talentro/services/clients.py,sha256=vluOrdYdDAQLyGR9-EmogLjA9OUlJtHy0tYD9LhwxKg,2174
30
30
  talentro/services/db.py,sha256=cnKCrYG7GwIu7ZZhA25D-yaXaiCJqPpzfcanWquyrBY,822
31
31
  talentro/services/google_storage.py,sha256=5r5uiDZD-76Dylc7yyRG5Ni4XNTc9xK8rC0glCRG8_8,6014
32
- talentro/services/rabbitmq.py,sha256=7qEKBc5Nk2kdjQzQVbyCgPrV3doJ4jIhKmVAWh6QN-k,10745
32
+ talentro/services/rabbitmq.py,sha256=7WYW94IAVWRg1utCDWG5BjsB8CTj-5m5_rspCTHxIyI,10995
33
33
  talentro/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  talentro/util/attributes.py,sha256=PgJnn9LMtHkiNIaMov2HQt5944HweD6gRlAHBZrJGPA,448
35
35
  talentro/util/enum.py,sha256=YftsoJKnrn8HAjA2Q1tqIYBMrNnlq6m1b34N8hfykbE,155
@@ -41,6 +41,6 @@ talentro/vacancies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
41
41
  talentro/vacancies/dataclasses.py,sha256=E6H5fsZH4IwtBFSLDolzF6u39tEIrANtWiNVoB65P0c,15074
42
42
  talentro/vacancies/models.py,sha256=GoXr71CNzU6csf8gdmv84etb3Rm-Cdfigp1yqPI_jjQ,4822
43
43
  talentro/vacancies/taxanomy.py,sha256=B6DMq9Wbs0aXFwD9aZveSlLwAC9eq1iCO_KM-FmrV7M,6384
44
- talentro_commons-0.20.4.dist-info/METADATA,sha256=geHN548LHvcVJxBDVyxAe442RsO3Mwyv4r5QuDmtsXc,1507
45
- talentro_commons-0.20.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
46
- talentro_commons-0.20.4.dist-info/RECORD,,
44
+ talentro_commons-0.20.5.dist-info/METADATA,sha256=1ROUYwJqviM43oHc9sta_CSOV6LgWsl2qFZFpDAOAHQ,1507
45
+ talentro_commons-0.20.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
46
+ talentro_commons-0.20.5.dist-info/RECORD,,