use of org.apache.activemq.artemis.jms.client.ActiveMQMessage in project midpoint by Evolveum.
the class TestAsyncProvisioningArtemis method getRequest.
@Override
protected String getRequest() throws JMSException {
Message msg = consumer.receiveNoWait();
displayValue("Message received", msg);
if (msg instanceof TextMessage) {
String text = ((TextMessage) msg).getText();
displayValue("Message " + msg.getJMSMessageID(), text);
return text;
} else if (msg instanceof ActiveMQMessage) {
ClientMessage coreMessage = ((ActiveMQMessage) msg).getCoreMessage();
String text = coreMessage.getBodyBuffer().readUTF();
displayValue("Message " + coreMessage.getMessageID(), text);
return text;
} else {
return null;
}
}
Aggregations