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) 

Source Link

Document

Constructs a JMSRuntimeException with the specified detail message

Usage

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

private void startClientInstance() {
    try {//from  www  .  ja v  a2 s. com
        // create a tcp connection to broker and some other background thread
        this.clientInstance = MQClientManager.getInstance().getAndCreateMQClientInstance(this.clientConfig);
        clientInstance.start();
    } catch (MQClientException e) {
        throw new JMSRuntimeException(format(
                "Fail to startClientInstance connection object[namesrvAddr:%s,instanceName:%s]. Error message:%s",
                this.clientConfig.getNamesrvAddr(), this.clientConfig.getInstanceName(), getStackTrace(e)));
    }
}

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

public RocketMQProducer(RocketMQSession session, Destination destination) {
    this.session = session;
    this.destination = destination;

    this.mqProducer = new DefaultMQProducer(UUID.randomUUID().toString());
    ClientConfig clientConfig = this.session.getConnection().getClientConfig();
    this.mqProducer.setNamesrvAddr(clientConfig.getNamesrvAddr());
    this.mqProducer.setInstanceName(clientConfig.getInstanceName());
    try {//from   w w  w . j  a v  a2 s  .co  m
        this.mqProducer.start();
    } catch (MQClientException e) {
        throw new JMSRuntimeException(format("Fail to start producer, error msg:%s", getStackTrace(e)));
    }
}