title: ActiveMQ / PHP Stomp use TextMessage instead of BytesMessage
body: <p>when I send a message to ActiveMQ using <a href="https://pecl.php.net/package/stomp" rel="nofollow">PHP-Stomp</a> the message is sent as BytesMessage. However I would like to send an TextMessage.</p>
  
  <p>According to the <a href="http://activemq.apache.org/stomp.html" rel="nofollow">STOMP documentation</a> this can be achieved by not sending an content-length header:</p>
  
  <blockquote>
    <p>... The protocol does however support a content-length
    header. To provide more robust interaction between Stomp and JMS
    clients, ActiveMQ keys off of the inclusion of this header to
    determine what message type to create when sending from Stomp to JMS.
    The logic is simple:</p>
    
    <p>Inclusion of content-length header => Resulting Message</p>
    
    <p>yes => BytesMessage </p>
    
    <p>no => TextMessage</p>
    
    <p>This same logic can be followed when going from JMS to Stomp, as well.
    A Stomp client could be written to key off of the inclusion of the
    content-length header to determine what type of message structure to
    provide to the user.</p>
  </blockquote>
  
  <p>In my test PHP script I have not defined the content-length header and it seems to be automaticly added.
  I also tried passing content-length as 0, false or null. In all of these cases it produces a BytesMessage.</p>
  
  <p>So my question is, <strong>how do I produce a Textmessage instead of BytesMessage</strong>.</p>
  
  <p>My code looks like the following:</p>
  
  <pre><code>&lt;?php
  
  $stomp = new Stomp('tcp://localhost:61613');
  $stomp-&gt;send('/topic/test.central_message_topic', 'testmessage', [
      "persistent" =&gt; "true",
  ]);
  </code></pre>