diff --git a/lib/event_source/protocols/amqp/bunny_queue_proxy.rb b/lib/event_source/protocols/amqp/bunny_queue_proxy.rb index eb04de9..c449ad8 100644 --- a/lib/event_source/protocols/amqp/bunny_queue_proxy.rb +++ b/lib/event_source/protocols/amqp/bunny_queue_proxy.rb @@ -135,7 +135,7 @@ def on_receive_message( subscriber = subscriber_klass.new subscriber.channel = @subject.channel - payload = decompress_payload_if_binary(payload) + payload = decode_payload(payload) subscription_handler = EventSource::Protocols::Amqp::BunnyConsumerHandler.new( subscriber, @@ -151,7 +151,7 @@ def on_receive_message( subscriber = nil end - def decompress_payload_if_binary(payload) + def decode_payload(payload) async_api_subscribe_operation = @async_api_channel_item.subscribe return payload unless async_api_subscribe_operation.message diff --git a/lib/event_source/publish_operation.rb b/lib/event_source/publish_operation.rb index 7eb6735..432fa8c 100644 --- a/lib/event_source/publish_operation.rb +++ b/lib/event_source/publish_operation.rb @@ -28,7 +28,7 @@ def initialize(channel, publish_proxy, async_api_publish_operation) # @example # #publish("Message", :headers => { }) def call(payload, options = {}) - payload = compress_payload_if_required(payload) + payload = encode_payload(payload) @subject.publish( payload: payload, publish_bindings: @async_api_publish_operation[:bindings], @@ -36,7 +36,7 @@ def call(payload, options = {}) ) end - def compress_payload_if_required(payload) + def encode_payload(payload) return payload unless @async_api_publish_operation.message message_bindings = @async_api_publish_operation.message['bindings']