ClientProducer producer = session.createProducer(QUEUE_EXAMPLE_QUEUE);
ClientMessage message = session.createMessage(false);
message.putStringProperty(BODY, "'" + txt + "' sent at " + new Date());
System.out.println("-----> Sending message");
producer.send(message);
<BUG>}
public List<String> readMessages(String txt) {</BUG>
synchronized (receivedMessages) {
List<String> list = new ArrayList<String>(receivedMessages);
receivedMessages.clear();

ClientProducer producer = session.createProducer(QUEUE_EXAMPLE_QUEUE);
ClientMessage message = session.createMessage(false);
message.putStringProperty(BODY, "'" + txt + "' sent at " + new Date());
System.out.println("-----> Sending message");
producer.send(message);
}
@Override
public List<String> readMessages(String txt) {
synchronized (receivedMessages) {
List<String> list = new ArrayList<String>(receivedMessages);
receivedMessages.clear();
