void pushMessage(String queueName, byte[] message) throws Exception {
    ActiveMQSpanConsumer consumer = collector.lazyInit.result;

    // Look up the existing session for this queue, so that there is no chance of flakes.
    QueueSession session = null;
    Queue queue = null;
    for (Map.Entry<QueueSession, QueueReceiver> entry : consumer.sessionToReceiver.entrySet()) {
      if (entry.getValue().getQueue().getQueueName().equals(queueName)) {
        session = entry.getKey();
        queue = entry.getValue().getQueue();
        break;
      }
    }
    if (session == null) {
      throw new NoSuchElementException("couldn't find session for queue " + queueName);
    }

    Connection conn = collector.lazyInit.result.connection;

    try (QueueSender sender = session.createSender(queue)) {
      BytesMessage bytesMessage = session.createBytesMessage();
      bytesMessage.writeBytes(message);
      sender.send(bytesMessage);
    }
  }
Guards against errors that leak from storage, such as InvalidQueryException
zipkin-collector/activemq/src/test/java/zipkin2/collector/activemq/ITActiveMQCollector.java