title: Sending JSON via ActiveMQ and Spring
body: <p>I'm trying to send a JSON object via ActiveMQ. I've tried sending simple <code>String</code> via ActiveMQ and instead of <code>{"a":1}</code> i've got something like this: <code>{\"a\":1}\n". I know that it's a proper</code>String` format, but the gson has failed to deserialize the string back to object. </p>
  
  <p>I have a listener like this:</p>
  
  <pre><code>    @JmsListener(destination = "requests.queue")
      @SendTo("responses.queue")
      public String onMessage(Message message) throws JMSException {
          String requestBody = ((TextMessage) message).getText();
          String response = myService(requestBody);
          return gson.toJson(response);
      }
  </code></pre>
  
  <p>This listener receives a request like <code>{"a":1}</code>, processes it via myService and push it back as a string. The only issue is that i'm unable to receive a proper JSON string. </p>
  
  <p>I know that I can use methods like <code>replase()</code> and clean the string, but as for me it's a really bad solution. </p>
  
  <p>Thanks.</p>