code: public void sendTextMessage(String queueName, String text, int deliveryMode, int priority, int timeToLive) {
          checkStarted();
  
          try(Session session = producerConnection.createSession()) {
              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 = session.createTextMessage(text);
  
              MessageProducer p = session.createProducer(queue);
              p.send(message, deliveryMode, priority, timeToLive);
          } catch (AsyncException e) {
              throw e;
          } catch (Exception e) {
              throw new AsyncException("Failed to send message", e);
          }
      }
docs: Sends a {@link TextMessage}.
  
  @param queueName name of queue
  @param text body of message
  @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)