use of com.swiftmq.impl.mqtt.po.POSendMessage in project swiftmq-ce by iitsoftware.
the class Subscription method processMessage.
@Override
public void processMessage(MessageEntry messageEntry) {
try {
QueuePullTransaction tx = consumer.createTransaction();
tx.moveToTransaction(messageEntry.getMessageIndex(), readTx);
String jmsTopicName = ((TopicImpl) messageEntry.getMessage().getJMSDestination()).getTopicName();
MqttQoS mqos = MqttQoS.valueOf(qos.value());
if (messageEntry.getMessage().propertyExists(Producer.PROP_QOS)) {
int pqos = messageEntry.getMessage().getIntProperty(Producer.PROP_QOS);
int sqos = qos.value();
if (sqos > pqos)
mqos = MqttQoS.valueOf(pqos);
}
session.getMqttConnection().getConnectionQueue().enqueue(new POSendMessage(jmsTopicName, messageEntry.getMessage(), mqos, tx, this));
incMsgsReceived(1);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations