use of com.swiftmq.jms.TextMessageImpl in project swiftmq-ce by iitsoftware.
the class SessionStore method add.
public synchronized void add(String clientid, MQTTSession session) throws Exception {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(ctx.mqttSwiftlet.getName(), toString() + ", add, clientid=" + clientid);
QueueSender sender = ctx.queueManager.createQueueSender(STORE_QUEUE, null);
QueuePushTransaction t = sender.createTransaction();
TextMessageImpl message = new TextMessageImpl();
message.setJMSDestination(new QueueImpl(STORE_QUEUE));
message.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
message.setJMSPriority(Message.DEFAULT_PRIORITY);
message.setJMSExpiration(Message.DEFAULT_TIME_TO_LIVE);
message.setJMSMessageID(MSGID + IdGenerator.getInstance().nextId('/'));
message.setStringProperty(PROP_CLIENTID, clientid);
message.setText(xStream.toXML(session.getSessionStoreEntry()));
t.putMessage(message);
t.commit();
sender.close();
}
use of com.swiftmq.jms.TextMessageImpl in project swiftmq-client by iitsoftware.
the class FileQueryPropsRequest method toMessage.
public Message toMessage() throws JMSException {
TextMessage message = new TextMessageImpl();
message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.FILEQUERYPROPS_REQ);
if (link != null)
message.setStringProperty(LINK_PROP, link);
fillMessage(message);
message.setText(selector);
return message;
}
use of com.swiftmq.jms.TextMessageImpl in project swiftmq-client by iitsoftware.
the class SessionCloseRequest method toMessage.
public Message toMessage() throws JMSException {
TextMessage message = new TextMessageImpl();
fillMessage(message);
message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.SESSIONCLOSE_REQ);
return message;
}
Aggregations