Search in sources :

Example 21 with Reply

use of com.swiftmq.tools.requestreply.Reply 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.v400.CreateConsumerRequest) JMSException(javax.jms.JMSException)

Example 22 with Reply

use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.

the class TopicConnectionConsumerImpl method createSubscriber.

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

Example 23 with Reply

use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.

the class SMQPVisitorAdapter method visit.

public void visit(XAResRollbackRequest req) {
    Reply reply = req.createReply();
    reply.setOk(false);
    reply.setException(new Exception("Please install the JMS XA/ASF Swiftlet to use this functionality!"));
    reply.send();
}
Also used : Reply(com.swiftmq.tools.requestreply.Reply)

Example 24 with Reply

use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.

the class SMQPVisitorAdapter method visit.

public void visit(XAResSetTxTimeoutRequest req) {
    Reply reply = req.createReply();
    reply.setOk(false);
    reply.setException(new Exception("Please install the JMS XA/ASF Swiftlet to use this functionality!"));
    reply.send();
}
Also used : Reply(com.swiftmq.tools.requestreply.Reply)

Example 25 with Reply

use of com.swiftmq.tools.requestreply.Reply in project swiftmq-client by iitsoftware.

the class SMQPVisitorAdapter method visit.

public void visit(CreateShadowConsumerRequest req) {
    Reply reply = req.createReply();
    reply.setOk(false);
    reply.setException(new Exception("Please install the JMS XA/ASF Swiftlet to use this functionality!"));
    reply.send();
}
Also used : Reply(com.swiftmq.tools.requestreply.Reply)

Aggregations

Reply (com.swiftmq.tools.requestreply.Reply)116 JMSException (javax.jms.JMSException)27 IllegalStateException (javax.jms.IllegalStateException)6 Dumpable (com.swiftmq.tools.dump.Dumpable)4 IOException (java.io.IOException)4 LengthCaptureDataInput (com.swiftmq.tools.util.LengthCaptureDataInput)3 DataInput (java.io.DataInput)3 NoSuchElementException (java.util.NoSuchElementException)3 JMSSecurityException (javax.jms.JMSSecurityException)3 InvalidVersionException (com.swiftmq.jms.InvalidVersionException)2 TopicImpl (com.swiftmq.jms.TopicImpl)2 CreateDurableReply (com.swiftmq.jms.smqp.v400.CreateDurableReply)2 CreateSubscriberReply (com.swiftmq.jms.smqp.v400.CreateSubscriberReply)2 CreateDurableReply (com.swiftmq.jms.smqp.v500.CreateDurableReply)2 CreateSubscriberReply (com.swiftmq.jms.smqp.v500.CreateSubscriberReply)2 CreateDurableReply (com.swiftmq.jms.smqp.v510.CreateDurableReply)2 CreateSubscriberReply (com.swiftmq.jms.smqp.v510.CreateSubscriberReply)2 CloseProducerRequest (com.swiftmq.jms.smqp.v400.CloseProducerRequest)1 CloseSessionRequest (com.swiftmq.jms.smqp.v400.CloseSessionRequest)1 CreateConsumerRequest (com.swiftmq.jms.smqp.v400.CreateConsumerRequest)1