code: public void send(String queueName, Command command, int deliveryMode, int priority, int timeToLive) {
          checkStarted();
  
          try(Session session = senderSessionPool.getSession()) {
              checkInRange(deliveryMode, 1, 2, "delivery mode");
              checkInRange(priority, 0, 9, "priority");
              if (timeToLive < 0)
                  throw new AsyncException("time to live cannot be negative");
  
              Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
              if (queue == null)
                  throw new AsyncException("Failed to find queue: " + queueName);
  
              Message message;
              if(binaryMode){
                  BytesMessage msg = session.createBytesMessage();
                  msg.writeBytes(command.toBytes());
                  message = msg;
              }else{
                  message = session.createTextMessage(command.toXml());
              }
  
              try(MessageProducer producer = session.createProducer(queue);) {
                  producer.send(message, deliveryMode, priority, timeToLive);
              }
  
          } catch (AsyncException e) {
              throw e;
          } catch (Exception e) {
              throw new AsyncException("Failed to send message", e);
          }
      }
docs: Sends a command into a queue for processing
  
  @param queueName name of queue
  @param command command to process
  @param deliveryMode delivery mode: {@link javax.jms.DeliveryMode}.
  @param priority priority of the message. Correct values are from 0 to 9, with higher number denoting a
  higher priority.
  @param timeToLive the message's lifetime (in milliseconds, where 0 is to never expire)