diff --git a/redis_queue/v1_0/outbound.py b/redis_queue/v1_0/outbound.py index 14a8965..b4a8484 100644 --- a/redis_queue/v1_0/outbound.py +++ b/redis_queue/v1_0/outbound.py @@ -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, @@ -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 @@ -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 {} @@ -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)