Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
feat: outbound message in handle message
Browse files Browse the repository at this point in the history
This updates to align with changes made upstream in:

openwallet-foundation/acapy#2170

Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Jul 5, 2023
1 parent a27cefe commit 3e10830
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions redis_queue/v1_0/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import json

import logging
from typing import List, Optional, Union
from typing import Union

from aries_cloudagent.core.profile import Profile
from aries_cloudagent.transport.outbound.base import (
BaseOutboundTransport,
OutboundTransportError,
QueuedOutboundMessage,
)
from aries_cloudagent.transport.wire_format import (
DIDCOMM_V0_MIME_TYPE,
Expand Down Expand Up @@ -41,7 +42,8 @@ def __init__(self, root_profile: Profile):
or OutboundConfig.default()
)
LOGGER.info(
f"Setting up redis outbound queue with configuration: {self.outbound_config}"
"Setting up redis outbound queue with configuration: %s",
self.outbound_config,
)
self.redis = root_profile.inject_or(RedisCluster)
self.is_mediator = self.outbound_config.mediator_mode
Expand All @@ -63,12 +65,13 @@ async def stop(self):
async def handle_message(
self,
profile: Profile,
payload: Union[str, bytes],
outbound_message: QueuedOutboundMessage,
endpoint: str,
metadata: dict = None,
api_key: str = None,
):
"""Prepare and send message to external queue."""
payload = outbound_message.payload
if not endpoint:
raise OutboundTransportError("No endpoint provided")
headers = metadata or {}
Expand Down Expand Up @@ -105,4 +108,4 @@ async def handle_message(
message,
)
except (RedisError, RedisClusterException) as err:
LOGGER.exception(f"Error while pushing to Redis: {err}")
LOGGER.exception("Error while pushing to Redis: %s", err)

0 comments on commit 3e10830

Please sign in to comment.