Search in sources :

Example 1 with CreateDurableReply

use of com.swiftmq.jms.smqp.v400.CreateDurableReply in project swiftmq-client by iitsoftware.

the class TopicConnectionConsumerImpl method createDurableSubscriber.

void createDurableSubscriber(TopicImpl topic, String messageSelector, String durableName) throws JMSException {
    try {
        SwiftUtilities.verifyDurableName(durableName);
    } catch (Exception e) {
        throw new JMSException(e.getMessage());
    }
    Reply reply = null;
    try {
        reply = requestRegistry.request(new CreateDurableRequest(dispatchId, topic, messageSelector, false, durableName));
    } catch (Exception e) {
        throw ExceptionConverter.convert(e);
    }
    if (reply.isOk()) {
        queueName = ((CreateDurableReply) reply).getQueueName();
    } else {
        throw ExceptionConverter.convert(reply.getException());
    }
    fillCache();
}
Also used : CreateDurableRequest(com.swiftmq.jms.smqp.v510.CreateDurableRequest) Reply(com.swiftmq.tools.requestreply.Reply) CreateDurableReply(com.swiftmq.jms.smqp.v510.CreateDurableReply) CreateSubscriberReply(com.swiftmq.jms.smqp.v510.CreateSubscriberReply) JMSException(javax.jms.JMSException) JMSException(javax.jms.JMSException)

Example 2 with CreateDurableReply

use of com.swiftmq.jms.smqp.v400.CreateDurableReply in project swiftmq-client by iitsoftware.

the class TopicConnectionConsumerImpl method createDurableSubscriber.

void createDurableSubscriber(TopicImpl topic, String messageSelector, String durableName) throws JMSException {
    try {
        SwiftUtilities.verifyDurableName(durableName);
    } catch (Exception e) {
        throw new JMSException(e.getMessage());
    }
    Reply reply = null;
    try {
        reply = (CreateDurableReply) requestRegistry.request(new CreateDurableRequest(dispatchId, (TopicImpl) topic, messageSelector, false, durableName));
    } catch (Exception e) {
        throw ExceptionConverter.convert(e);
    }
    if (reply.isOk()) {
        queueName = ((CreateDurableReply) reply).getQueueName();
    } else {
        throw ExceptionConverter.convert(reply.getException());
    }
    fillCache();
}
Also used : CreateDurableRequest(com.swiftmq.jms.smqp.v500.CreateDurableRequest) Reply(com.swiftmq.tools.requestreply.Reply) CreateSubscriberReply(com.swiftmq.jms.smqp.v500.CreateSubscriberReply) CreateDurableReply(com.swiftmq.jms.smqp.v500.CreateDurableReply) JMSException(javax.jms.JMSException) TopicImpl(com.swiftmq.jms.TopicImpl) JMSException(javax.jms.JMSException)

Example 3 with CreateDurableReply

use of com.swiftmq.jms.smqp.v400.CreateDurableReply in project swiftmq-client by iitsoftware.

the class TopicConnectionConsumerImpl method createDurableSubscriber.

void createDurableSubscriber(TopicImpl topic, String messageSelector, String durableName) throws JMSException {
    try {
        SwiftUtilities.verifyDurableName(durableName);
    } catch (Exception e) {
        throw new JMSException(e.getMessage());
    }
    Reply reply = null;
    try {
        reply = (CreateDurableReply) requestRegistry.request(new CreateDurableRequest(dispatchId, (TopicImpl) topic, messageSelector, false, durableName));
    } catch (Exception e) {
        throw ExceptionConverter.convert(e);
    }
    if (reply.isOk()) {
        queueName = ((CreateDurableReply) reply).getQueueName();
    } else {
        throw ExceptionConverter.convert(reply.getException());
    }
    fillCache();
}
Also used : CreateDurableRequest(com.swiftmq.jms.smqp.v400.CreateDurableRequest) Reply(com.swiftmq.tools.requestreply.Reply) CreateSubscriberReply(com.swiftmq.jms.smqp.v400.CreateSubscriberReply) CreateDurableReply(com.swiftmq.jms.smqp.v400.CreateDurableReply) JMSException(javax.jms.JMSException) TopicImpl(com.swiftmq.jms.TopicImpl) JMSException(javax.jms.JMSException)

Aggregations

Reply (com.swiftmq.tools.requestreply.Reply)3 JMSException (javax.jms.JMSException)3 TopicImpl (com.swiftmq.jms.TopicImpl)2 CreateDurableReply (com.swiftmq.jms.smqp.v400.CreateDurableReply)1 CreateDurableRequest (com.swiftmq.jms.smqp.v400.CreateDurableRequest)1 CreateSubscriberReply (com.swiftmq.jms.smqp.v400.CreateSubscriberReply)1 CreateDurableReply (com.swiftmq.jms.smqp.v500.CreateDurableReply)1 CreateDurableRequest (com.swiftmq.jms.smqp.v500.CreateDurableRequest)1 CreateSubscriberReply (com.swiftmq.jms.smqp.v500.CreateSubscriberReply)1 CreateDurableReply (com.swiftmq.jms.smqp.v510.CreateDurableReply)1 CreateDurableRequest (com.swiftmq.jms.smqp.v510.CreateDurableRequest)1 CreateSubscriberReply (com.swiftmq.jms.smqp.v510.CreateSubscriberReply)1