Skip to content

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 716db6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 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,7 @@ 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 +64,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 +107,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 716db6c

Please sign in to comment.