Example usage for javax.jms JMSRuntimeException JMSRuntimeException

List of usage examples for javax.jms JMSRuntimeException JMSRuntimeException

Introduction

In this page you can find the example usage for javax.jms JMSRuntimeException JMSRuntimeException.

Prototype

public JMSRuntimeException(String detailMessage, String errorCode) 

Source Link

Document

Constructs a JMSRuntimeException with the specified detail message and error code.

Usage

From source file:org.apache.rocketmq.jms.DeliverMessageService.java

private void createAndStartRocketMQPullConsumer() {
    final ClientConfig clientConfig = this.consumer.getSession().getConnection().getClientConfig();
    this.rocketMQPullConsumer = new DefaultMQPullConsumer(consumerGroup);
    this.rocketMQPullConsumer.setNamesrvAddr(clientConfig.getNamesrvAddr());
    this.rocketMQPullConsumer.setInstanceName(clientConfig.getInstanceName());

    try {//from   ww w . j  ava2  s  .  c om
        this.rocketMQPullConsumer.start();
    } catch (MQClientException e) {
        throw new JMSRuntimeException("Fail to start RocketMQ pull consumer, error msg:%s",
                ExceptionUtils.getStackTrace(e));
    }
}

From source file:org.grouter.common.jms.QueueSenderDestination.java

/**
 * <b>See documentaion in {@link org.grouter.common.jms.QueueSenderDestination#sendMessage(String)}.</b><br>
 * <br>/* w  w w .  j a  v a 2 s .  c  o m*/
 */
public synchronized void sendMessage(String message) {
    try {
        ObjectMessage msg = this.queueSession.createObjectMessage(message);
        setJMSHeader(msg);
        queueSender.send(msg);
        logger.debug("Message sent to destination : " + destinationName);
    } catch (Exception ex) {
        logger.error("Failed sending message to JMS provider using destination " + destinationName
                + ". Error message : " + ex.getMessage());
        throw new JMSRuntimeException("Could not send message.", ex);
    }
}

From source file:org.grouter.common.jms.QueueSenderDestination.java

@Override
public synchronized void sendMessage(Serializable message, int deliveryMode, int messagePriority,
        long timeToLive, HashMap<String, String> headerProperties) {

    try {// ww  w  . j  a v a  2s  .c  o  m
        ObjectMessage msg = createMessage(message, headerProperties);
        setJMSHeader(msg);
        queueSender.send(msg, deliveryMode, messagePriority, timeToLive);
        logger.debug("Message sent to destination : " + destinationName);
    } catch (Exception ex) {
        logger.error("Failed sending message to JMS provider using destination " + destinationName
                + ". Error message : " + ex.getMessage());
        throw new JMSRuntimeException("Could not send message.", ex);
    }

}

From source file:org.grouter.common.jms.QueueSenderDestination.java

@Override
public synchronized void sendMessage(Serializable message, HashMap<String, String> headerProperties) {
    try {/*from  w  w  w .  j  a v  a2s . c  o  m*/
        ObjectMessage msg = createMessage(message, headerProperties);
        setJMSHeader(msg);
        queueSender.send(msg, this.acknowledgeMode, this.messagePriority, this.timeToLive);
        logger.debug("Message sent to destination : " + destinationName);
    } catch (Exception ex) {
        logger.error("Failed sending message to JMS provider using destination " + destinationName
                + ". Error message : " + ex.getMessage());
        throw new JMSRuntimeException("Could not send message.", ex);
    }
}

From source file:org.grouter.common.jms.QueueSenderDestination.java

@Override
public synchronized void sendMessage(Serializable message) {
    try {/*from ww  w  . ja v a  2 s.  c o m*/
        ObjectMessage msg = createMessage(message, null);
        setJMSHeader(msg);
        queueSender.send(msg);
        logger.debug("Message sent to destination : " + destinationName);
    } catch (JMSException ex) {
        logger.error("Failed sending message to JMS provider using destination " + destinationName
                + ". Error message : " + ex.getMessage());
        throw new JMSRuntimeException("Could not send message.", ex);
    }
}

From source file:org.grouter.common.jms.QueueSenderDestination.java

@Override
public synchronized void sendMessage(Message message, int deliveryMode, int messagePriority, long timeToLive) {
    try {/*from  w  w w . j a v a2  s  . com*/
        setJMSHeader(message);
        queueSender.send(message, deliveryMode, messagePriority, timeToLive);
        logger.debug("Message sent to destination : " + destinationName);

    } catch (Exception ex) {
        logger.error("Failed sending message to JMS provider using destination " + destinationName
                + ". Error message : " + ex.getMessage());
        throw new JMSRuntimeException("Could not send message.", ex);
    }
}

From source file:org.grouter.common.jms.QueueSenderDestination.java

@Override
public synchronized void sendMessage(Message message) {
    try {//from   w ww. j  a v  a 2s . com
        setJMSHeader(message);
        queueSender.send(message);
        logger.debug("Message sent to destination : " + destinationName);
    } catch (Exception ex) {
        logger.error("Failed sending message to JMS provider using destination " + destinationName
                + ". Error message : " + ex.getMessage());
        throw new JMSRuntimeException("Could not send message.", ex);
    }
}