use of com.swiftmq.jms.smqp.v510.CreateSessionRequest in project swiftmq-client by iitsoftware.
the class TopicConnectionImpl method createTopicSession.
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException {
verifyState();
SessionImpl topicSession = null;
CreateSessionReply reply = null;
try {
reply = (CreateSessionReply) requestRegistry.request(new CreateSessionRequest(transacted, acknowledgeMode, CreateSessionRequest.TOPIC_SESSION));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (reply.isOk()) {
int dispatchId = reply.getSessionDispatchId();
String cid = clientID != null ? clientID : internalCID;
topicSession = new SessionImpl(SessionImpl.TYPE_TOPIC_SESSION, this, transacted, acknowledgeMode, dispatchId, requestRegistry, myHostname, cid);
topicSession.setUserName(userName);
topicSession.setMyDispatchId(addRequestService(topicSession));
addSession(topicSession);
} else {
throw ExceptionConverter.convert(reply.getException());
}
return (topicSession);
}
use of com.swiftmq.jms.smqp.v510.CreateSessionRequest in project swiftmq-client by iitsoftware.
the class TopicConnectionImpl method createTopicSession.
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException {
verifyState();
SessionImpl topicSession = null;
CreateSessionReply reply = null;
try {
reply = (CreateSessionReply) requestRegistry.request(new CreateSessionRequest(transacted, acknowledgeMode, CreateSessionRequest.TOPIC_SESSION));
} catch (Exception e) {
throw ExceptionConverter.convert(e);
}
if (reply.isOk()) {
int dispatchId = reply.getSessionDispatchId();
String cid = clientID != null ? clientID : internalCID;
topicSession = new SessionImpl(SessionImpl.TYPE_TOPIC_SESSION, this, transacted, acknowledgeMode, dispatchId, requestRegistry, myHostname, cid);
topicSession.setUserName(userName);
topicSession.setMyDispatchId(addRequestService(topicSession));
addSession(topicSession);
} else {
throw ExceptionConverter.convert(reply.getException());
}
return (topicSession);
}
Aggregations