code: def test_zmq_pub_sub(faker: Faker, producer, consumer):
      received_messages = []
  
      pub_addr = get_queue_address(producer.port)
  
      assert producer.address == pub_addr
      assert isinstance(producer.backend, Socket)
      assert isinstance(producer, ZMQProducer)
      assert producer.alive
  
      queue_name = producer.queue_name
  
      first_message = faker.sentence().encode()
  
      class MyMessageHandler(AbstractMessageHandler):
          queue = producer.queue_name
  
          @staticmethod
          def handle_message(message: bytes, *args, **kwargs):
              received_messages.append(message)
  
      consumer.message_handler = MyMessageHandler
  
      assert isinstance(consumer, ZMQConsumer)
      assert consumer.address == pub_addr
      assert isinstance(consumer.worker, Socket)
      assert consumer.queue_name == queue_name
      assert consumer.alive
      assert consumer.thread is None
      assert consumer.message_handler == MyMessageHandler
      consumer.run()
      sleep(0.2)
  
      msg = [producer.id.encode(), b"", first_message]
      producer.send(message=msg, worker=consumer.id.encode())
  
      # Check if consumer receives the message
      # consumer.receive()
      sleep(0.2)
  
      # Validate if message was correctly received in the handler
      assert len(received_messages) == 1
      assert first_message in received_messages
  
      # Close all socket connections
      producer.close()
      consumer.close()
      assert producer.alive is False
      assert consumer.alive is False
  
imports: from collections import defaultdict
  import random
  import sys
  from time import sleep
  from faker import Faker
  import pytest
  from zmq import Socket
  import syft
  from syft.service.queue.base_queue import AbstractMessageHandler
  from syft.service.queue.queue import QueueManager
  from syft.service.queue.zmq_queue import ZMQClient
  from syft.service.queue.zmq_queue import ZMQClientConfig
  from syft.service.queue.zmq_queue import ZMQConsumer
  from syft.service.queue.zmq_queue import ZMQProducer
  from syft.service.queue.zmq_queue import ZMQQueueConfig
  from syft.service.response import SyftError
  from syft.service.response import SyftSuccess
  from syft.util.util import get_queue_address
label_desc: Use image node_id 6 for calling a global function with example usage: test_zmq_pub_sub(faker, producer, consumer) without return types