当前位置: 首页>>代码示例>>Java>>正文


Java DefaultMessageListenerContainer.setDestinationName方法代码示例

本文整理汇总了Java中org.springframework.jms.listener.DefaultMessageListenerContainer.setDestinationName方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultMessageListenerContainer.setDestinationName方法的具体用法?Java DefaultMessageListenerContainer.setDestinationName怎么用?Java DefaultMessageListenerContainer.setDestinationName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.jms.listener.DefaultMessageListenerContainer的用法示例。


在下文中一共展示了DefaultMessageListenerContainer.setDestinationName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: responder

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer responder() {
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory(connectionFactory());
	container.setDestinationName("test.out");
	MessageListenerAdapter adapter = new MessageListenerAdapter(new Object() {

		@SuppressWarnings("unused")
		public String handleMessage(String in) {
			return in.toUpperCase();
		}

	});
	container.setMessageListener(adapter);
	return container;
}
 
开发者ID:snicoll,项目名称:scratches,代码行数:17,代码来源:JmsRequestReply.java

示例2: messageListener

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer messageListener() {
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory(this.connectionFactory);
	container.setDestinationName("testQueue");
	container.setMessageListener(new MessageListener() {
		@Override
		public void onMessage(Message message) {
			try {
				System.out.println(message.getBody(Object.class));
			}
			catch (JMSException ex) {
				ex.printStackTrace();
			}
		}
	});
	return container;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:SampleHornetQApplication.java

示例3: init

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Override
public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
  
  final AnalyticServiceServer server = new AnalyticServiceServer(getViewProcessor(), getPositionMaster(), getPortfolioMaster(), getConfigSource());
  server.setUser(getUser());
  server.setViewName(getViewName());
  server.setProviderIdName(getProviderIdName());
  
  AnalyticServiceTradeProducer tradeProducer = new AnalyticServiceTradeProducer();
  
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setMessageListener(
      new JmsByteArrayMessageDispatcher(
          new ByteArrayFudgeMessageReceiver(tradeProducer)));
  container.setDestinationName(getListenTopicName());
  container.setPubSubDomain(false);
  container.setConnectionFactory(getListenJmsConnector().getConnectionFactory());
  
  JmsAnalyticsDistributor analyticsDistributor = new JmsAnalyticsDistributor(new DefaultJmsTopicNameResolver(getPositionSource()), OpenGammaFudgeContext.getInstance(), _listenJmsConnector);
  server.setAnalyticResultReceiver(analyticsDistributor);
  
  server.setTradeProducer(tradeProducer);
  repo.registerLifecycle(server);
  repo.registerLifecycle(container);
  
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:27,代码来源:AnalyticServiceServerFactory.java

示例4: setUpClass

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@BeforeClass
public void setUpClass() {
  JmsConnector jmsConnector = ActiveMQTestUtils.createTestJmsConnector();
  
  _factory = new JmsSenderFactory(jmsConnector);
  _mdd = MarketDataDistributorTest.getTestDistributor(_factory);
  
  _collectingReceiver = new CollectingByteArrayMessageReceiver();
  JmsByteArrayMessageDispatcher messageDispatcher = new JmsByteArrayMessageDispatcher(_collectingReceiver);
  
  _container = new DefaultMessageListenerContainer();
  _container.setConnectionFactory(jmsConnector.getConnectionFactory());
  _container.setMessageListener(messageDispatcher);
  _container.setDestinationName(_mdd.getDistributionSpec().getJmsTopic());
  _container.setPubSubDomain(true);
  _container.afterPropertiesSet();
  _container.start();
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:19,代码来源:JmsSenderTest.java

示例5: startListener

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
public void startListener() {
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter();
    messageListenerAdapter.setDelegate(this);
    messageListenerAdapter.setMessageConverter(mqMessageConverter);

    DefaultMessageListenerContainer mqListener = new DefaultMessageListenerContainer();
    mqListener.setConnectionFactory(mqConnectionFactory.getFactory());
    mqListener.setDestinationName(appConfig.getMqQueueName());
    mqListener.setMessageListener(messageListenerAdapter);
    mqListener.setConcurrency("4-8");
    mqListener.setSessionTransacted(true);

    mqListener.initialize();
    mqListener.start();
}
 
开发者ID:phpdragon,项目名称:JavaSamples,代码行数:16,代码来源:MqConsumer.java

示例6: registerMessageListener

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
public void registerMessageListener(MessageListener listener,
                                    String destinationName)
{
  log.info("registerMessageListener(" + destinationName + ", " + listener + ")");
  container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(connectionFactory);
  container.setDestinationName(destinationName);
  container.setMessageListener(listener);
  container.setTaskExecutor(taskExecutor);
  container.afterPropertiesSet();
  container.start();
  
  listenerContainerMap.put(listener, container);
}
 
开发者ID:LARG,项目名称:TacTex,代码行数:15,代码来源:JmsManagementService.java

示例7: messageListener

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer messageListener() {
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory(this.connectionFactory);
	container.setDestinationName(queue);
	container.setMessageListener(new Consumer());
	return container;
}
 
开发者ID:Apress,项目名称:pro-spring-boot,代码行数:9,代码来源:MessagingConfig.java

示例8: serverRequestListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer serverRequestListenerContainer() {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(singleConnectionFactory());
  container.setDestinationName("replaced-at-runtime");
  container.setSessionTransacted(false);
  container.setMaxMessagesPerTask(1);
  container.setReceiveTimeout(1000);
  container.setIdleTaskExecutionLimit(10);
  container.setAutoStartup(false);
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:13,代码来源:JmsConfig.java

示例9: secondServerRequestListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer secondServerRequestListenerContainer() {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(secondSingleConnectionFactory());
  container.setDestinationName("replaced-at-runtime");
  container.setSessionTransacted(false);
  container.setMaxMessagesPerTask(1);
  container.setReceiveTimeout(1000);
  container.setIdleTaskExecutionLimit(10);
  container.setAutoStartup(false);
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:13,代码来源:JmsConfig.java

示例10: buildListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
/**
 * 构建基于队列模式的消息监听容器
 *
 * @param queueName 队列名字
 * @param rpcServiceExport 服务暴露接口
 * @return
 */
protected MessageListenerContainer buildListenerContainer(JmsInvokerServiceExporter rpcServiceExport,
        String queueName) {
    DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
    container.setConnectionFactory(jmsConnectionFactory());
    container.setDestinationName(queueName);
    container.setMessageConverter(messageConverter());
    container.setMessageListener(rpcServiceExport);
    container.setConcurrentConsumers(Runtime.getRuntime().availableProcessors());
    return container;
}
 
开发者ID:projectsrepos,项目名称:jim,代码行数:18,代码来源:GenericMQConfig.java

示例11: mqMessageReceiver

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
/**
 * 配置基于发布订阅模式的消息监听容器,用于接收MQ转发过来的消息
 *
 * @param topicName
 * @param messageListener
 * @return
 */
public MessageListenerContainer mqMessageReceiver(String topicName, MessageListener messageListener) {
    DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
    container.setConnectionFactory(jmsConnectionFactory());
    container.setDestinationName(topicName);
    container.setPubSubDomain(true);
    container.setPubSubNoLocal(true);
    container.setMessageListener(messageListener);
    container.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
    return container;
}
 
开发者ID:projectsrepos,项目名称:jim,代码行数:18,代码来源:GenericMQConfig.java

示例12: init

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Override
public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
  LastKnownValueStoreProvider lkvStoreProvider =
      CogdaFactoryUtil.constructLastKnownValueStoreProvider(
          getDataRedisServer(),
          getDataRedisPort(),
          getDataRedisPrefix(),
          false,
          s_logger);
  CogdaLiveDataServer liveDataServer = new CogdaLiveDataServer(lkvStoreProvider);
  if (getListenPort() != null) {
    liveDataServer.setPortNumber(getListenPort());
  }
  liveDataServer.registerMetrics(OpenGammaMetricRegistry.getSummaryInstance(), OpenGammaMetricRegistry.getDetailedInstance(), "CogdaLiveDataServer");
  
  CogdaLiveDataServerUpdateListener updateListener = new CogdaLiveDataServerUpdateListener(liveDataServer);
  
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setMessageListener(
      new JmsByteArrayMessageDispatcher(
          new ByteArrayFudgeMessageReceiver(updateListener)));
  container.setDestinationName(getListenTopicName());
  container.setPubSubDomain(true);
  container.setConnectionFactory(getListenJmsConnector().getConnectionFactory());
  
  CogdaLiveDataServerMBean mbean = new CogdaLiveDataServerMBean(liveDataServer);
  
  repo.registerLifecycle(liveDataServer);
  repo.registerLifecycle(container);
  repo.registerMBean(mbean);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:32,代码来源:CogdaLiveDataServerFactory.java

示例13: listenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public AbstractMessageListenerContainer listenerContainer() {
    final DefaultMessageListenerContainer defaultMessageListenerContainer = new DefaultMessageListenerContainer();
    defaultMessageListenerContainer.setConnectionFactory(connectionFactory());
    defaultMessageListenerContainer.setConcurrency(listenerContainerConcurrency);
    defaultMessageListenerContainer.setDestinationName(queueName);
    defaultMessageListenerContainer.setMessageListener(queueListener());

    return defaultMessageListenerContainer;
}
 
开发者ID:przodownikR1,项目名称:jmsKata,代码行数:11,代码来源:JmsConfig.java

示例14: defaultMessageListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer defaultMessageListenerContainer(MessageListener messageListener, ConnectionFactory connectionFactory, Log log) {
    log.info("serve DefaultMessageListenerContainer");
    DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
    container.setConnectionFactory(connectionFactory);
    container.setDestinationName("test");
    container.setMessageListener(messageListener);
    return container;
}
 
开发者ID:thma,项目名称:fmek,代码行数:10,代码来源:JmsConfiguration.java

示例15: deleteContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
   DefaultMessageListenerContainer deleteContainer(MessageListenerAdapter deleteListenerAdapter,
    ConnectionFactory connectionFactory) {
DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
container.setMessageListener(deleteListenerAdapter);
container.setConnectionFactory(connectionFactory);
container.setDestinationName(deleteDocumentsQueueName);
return container;
   }
 
开发者ID:nationalarchives,项目名称:taxonomy,代码行数:10,代码来源:DeleteMsgConfiguration.java


注:本文中的org.springframework.jms.listener.DefaultMessageListenerContainer.setDestinationName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。