Example usage for org.springframework.jms.remoting JmsInvokerProxyFactoryBean setQueueName

List of usage examples for org.springframework.jms.remoting JmsInvokerProxyFactoryBean setQueueName

Introduction

In this page you can find the example usage for org.springframework.jms.remoting JmsInvokerProxyFactoryBean setQueueName.

Prototype

public void setQueueName(String queueName) 

Source Link

Document

Set the name of target queue to send invoker requests to.

Usage

From source file:org.nebulaframework.util.jms.JMSRemotingSupport.java

/**
 * Creates and returns a proxy object which can be
 * used to consume a remote service./* w  w w . j  a v  a 2  s . co  m*/
 * 
 * @param <T> Type of Service Interface
 * @param cf JMS Connection Factory
 * @param queueName Name of JMS Queue used for communication
 * @param serviceClass Service Interface Class
 * @return Proxy for the remote service
 */
@SuppressWarnings("unchecked")
/* Ignore Unchecked Cast */
public static <T> T createProxy(ConnectionFactory cf, String queueName, Class<T> serviceClass) {

    // Create Proxy Factory Instance
    JmsInvokerProxyFactoryBean proxyFactory = new JmsInvokerProxyFactoryBean();
    proxyFactory.setConnectionFactory(cf);
    proxyFactory.setQueueName(queueName);
    proxyFactory.setServiceInterface(serviceClass);
    proxyFactory.afterPropertiesSet();

    // Return Proxy
    return (T) proxyFactory.getObject();
}

From source file:com.jim.im.config.GenericMQConfig.java

/**
 * RPC??/*w  ww .j a v  a2 s  . co  m*/
 *
 * @param queueName ??
 * @param serviceInterfaceClazz ???
 * @return
 */
protected JmsInvokerProxyFactoryBean buildRpcServiceProxyFactoryBean(String queueName,
        Class<?> serviceInterfaceClazz) {
    JmsInvokerProxyFactoryBean proxy = new JmsInvokerProxyFactoryBean();
    proxy.setConnectionFactory(jmsConnectionFactory());
    proxy.setMessageConverter(messageConverter());
    proxy.setQueueName(queueName);
    proxy.setServiceInterface(serviceInterfaceClazz);
    return proxy;
}