Search in sources :

Example 6 with CreateConsumerRequest

use of com.swiftmq.jms.smqp.v500.CreateConsumerRequest in project swiftmq-client by iitsoftware.

the class QueueConnectionConsumerImpl method createConsumer.

void createConsumer(QueueImpl queue, String messageSelector) throws JMSException {
    if (queue == null)
        throw new NullPointerException("createConsumer, queue is null!");
    queueName = queue.getQueueName();
    this.queue = queue;
    this.messageSelector = messageSelector;
    Reply reply = null;
    try {
        reply = requestRegistry.request(new CreateConsumerRequest(this, dispatchId, (QueueImpl) queue, messageSelector));
    } catch (Exception e) {
        throw ExceptionConverter.convert(e);
    }
    if (!reply.isOk())
        throw ExceptionConverter.convert(reply.getException());
    fillCache();
}
Also used : Reply(com.swiftmq.tools.requestreply.Reply) CreateSessionReply(com.swiftmq.jms.smqp.v600.CreateSessionReply) CreateConsumerRequest(com.swiftmq.jms.smqp.v600.CreateConsumerRequest) JMSException(javax.jms.JMSException)

Example 7 with CreateConsumerRequest

use of com.swiftmq.jms.smqp.v500.CreateConsumerRequest in project swiftmq-client by iitsoftware.

the class QueueConnectionConsumerImpl method createConsumer.

void createConsumer(QueueImpl queue, String messageSelector) throws JMSException {
    if (queue == null)
        throw new NullPointerException("createConsumer, queue is null!");
    queueName = queue.getQueueName();
    Reply reply = null;
    try {
        reply = requestRegistry.request(new CreateConsumerRequest(dispatchId, (QueueImpl) queue, messageSelector));
    } catch (Exception e) {
        throw ExceptionConverter.convert(e);
    }
    if (!reply.isOk())
        throw ExceptionConverter.convert(reply.getException());
    fillCache();
}
Also used : Reply(com.swiftmq.tools.requestreply.Reply) CreateConsumerRequest(com.swiftmq.jms.smqp.v500.CreateConsumerRequest) JMSException(javax.jms.JMSException)

Aggregations

Reply (com.swiftmq.tools.requestreply.Reply)7 JMSException (javax.jms.JMSException)7 CreateConsumerRequest (com.swiftmq.jms.smqp.v400.CreateConsumerRequest)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v500.CreateConsumerRequest)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v510.CreateConsumerRequest)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v600.CreateConsumerRequest)1 CreateSessionReply (com.swiftmq.jms.smqp.v600.CreateSessionReply)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v610.CreateConsumerRequest)1 CreateSessionReply (com.swiftmq.jms.smqp.v610.CreateSessionReply)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v630.CreateConsumerRequest)1 CreateSessionReply (com.swiftmq.jms.smqp.v630.CreateSessionReply)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v750.CreateConsumerRequest)1 CreateSessionReply (com.swiftmq.jms.smqp.v750.CreateSessionReply)1