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


Java DefaultMessageListenerContainer.setDestination方法代码示例

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


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

示例1: adminRequestJmsContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer adminRequestJmsContainer(ClientRequestDelegator delegator, ClientRequestErrorHandler errorHandler) {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();

  String adminRequestQueue = properties.getJms().getAdminRequestQueue();
  container.setDestination(new ActiveMQQueue(adminRequestQueue));

  container.setConnectionFactory(adminSingleConnectionFactory());
  container.setMessageListener(delegator);
  container.setConcurrentConsumers(1);
  container.setMaxConcurrentConsumers(2);
  container.setMaxMessagesPerTask(1);
  container.setReceiveTimeout(1000);
  container.setIdleTaskExecutionLimit(600);
  container.setSessionTransacted(false);
  container.setTaskExecutor(clientExecutor);
  container.setErrorHandler(errorHandler);
  container.setAutoStartup(false);
  container.setPhase(ServerConstants.PHASE_INTERMEDIATE);
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:22,代码来源:AdminJmsConfig.java

示例2: taskMessageListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
@Autowired
public DefaultMessageListenerContainer taskMessageListenerContainer(JmsExternalCommandListener externalTaskListener
        , ConnectionFactory connectionFactory
        , ActiveMQQueue taskQueue) {
    DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
    listenerContainer.setMessageListener(externalTaskListener);
    listenerContainer.setDestination(taskQueue);
    listenerContainer.setConnectionFactory(connectionFactory);

    listenerContainer.setAcceptMessagesWhileStopping(false);
    listenerContainer.setSessionTransacted(true);
    listenerContainer.setConcurrentConsumers(concurrentConsumers);
    listenerContainer.setMaxMessagesPerTask(maxMessagesPerTask);
    listenerContainer.setReceiveTimeout(receiveTimeout);
    LOG.debug("DefaultMessageListenerContainer for queue [{}] with message selector [{}] was started", listenerContainer.getDestination(), listenerContainer.getMessageSelector());
    return listenerContainer;
}
 
开发者ID:EsikAntony,项目名称:camunda-task-dispatcher,代码行数:19,代码来源:JmsExternalCommandListenerConfig.java

示例3: taskMessageListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
@Autowired
public DefaultMessageListenerContainer taskMessageListenerContainer(JmsExternalTaskListener externalTaskListener
        , ConnectionFactory receiverConnectionFactory
        , ActiveMQQueue taskQueue) {
    DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
    listenerContainer.setMessageListener(externalTaskListener);
    listenerContainer.setDestination(taskQueue);
    listenerContainer.setConnectionFactory(receiverConnectionFactory);

    listenerContainer.setAcceptMessagesWhileStopping(false);
    listenerContainer.setSessionTransacted(true);
    listenerContainer.setConcurrentConsumers(concurrentConsumers);
    listenerContainer.setMaxMessagesPerTask(maxMessagesPerTask);
    listenerContainer.setReceiveTimeout(receiveTimeout);
    return listenerContainer;
}
 
开发者ID:EsikAntony,项目名称:camunda-task-dispatcher,代码行数:18,代码来源:JmsExternalTaskReceiverConfig.java

示例4: clientRequestJmsContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer clientRequestJmsContainer(ClientRequestDelegator delegator, ClientRequestErrorHandler errorHandler) {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();

  String clientRequestQueue = properties.getJms().getRequestQueue();
  container.setDestination(new ActiveMQQueue(clientRequestQueue));

  container.setConnectionFactory(clientSingleConnectionFactory());
  container.setMessageListener(delegator);
  container.setConcurrentConsumers(properties.getJms().getInitialConsumers());
  container.setMaxConcurrentConsumers(properties.getJms().getMaxConsumers());
  container.setMaxMessagesPerTask(1);
  container.setReceiveTimeout(1000);
  container.setIdleTaskExecutionLimit(600);
  container.setSessionTransacted(false);
  container.setTaskExecutor(clientExecutor());
  container.setErrorHandler(errorHandler);
  container.setAutoStartup(false);
  container.setPhase(ServerConstants.PHASE_INTERMEDIATE);
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:22,代码来源:ClientJmsConfig.java

示例5: configRequestJmsContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer configRequestJmsContainer(ConfigurationRequestHandler requestHandler) {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();

  String configRequestQueue = properties.getJms().getConfigRequestQueue();
  container.setDestination(new ActiveMQQueue(configRequestQueue));

  container.setConnectionFactory(clientSingleConnectionFactory);
  container.setMessageListener(requestHandler);
  container.setConcurrentConsumers(1);
  container.setMaxConcurrentConsumers(1);
  container.setSessionTransacted(false);
  container.setTaskExecutor(clientExecutor);
  container.setPhase(ServerConstants.PHASE_START_LAST);
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:17,代码来源:ConfigRequestJmsConfig.java

示例6: subscribe

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
/**
 * Returns the container so that it can be started manually when added during
 * server runtime.
 * @param process the Process to create a container for
 * @param consumersMax the max number of consumers (at start-up subscribe with less)
 * @return the JMS container that was created
 */
private DefaultMessageListenerContainer subscribe(final Process process, final int consumersMax) {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(updateConnectionFactory);
  container.setDestination(new ActiveMQQueue(properties.getJms().getQueuePrefix() + ".update." + process.getName()));
  container.setMessageListener(listener);
  container.setConcurrentConsumers(properties.getJms().getUpdate().getInitialConsumers());
  container.setMaxConcurrentConsumers(consumersMax);
  container.setSessionTransacted(properties.getJms().getUpdate().isTransacted());
  container.setCacheLevel(DefaultMessageListenerContainer.CACHE_CONSUMER);
  container.setAutoStartup(false);
  container.setPhase(ServerConstants.PHASE_START_LAST);
  container.setMaxMessagesPerTask(properties.getJms().getUpdate().getMaxMessagesPerTask());
  container.setReceiveTimeout(properties.getJms().getUpdate().getReceiveTimeout());
  container.setIdleTaskExecutionLimit(properties.getJms().getUpdate().getIdleTaskExecutionLimit());
  container.setBeanName(process.getName() + " update JMS container");
  container.setTaskExecutor(daqThreadPoolTaskExecutor);
  container.setAcceptMessagesWhileStopping(false);
  jmsContainers.put(process.getId(), container);
  container.initialize();
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:29,代码来源:JmsContainerManagerImpl.java

示例7: hornetQMessageListenerContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public MessageListenerContainer hornetQMessageListenerContainer() {
	Map<String, Object> map = new HashMap<String, Object>();
       map.put(TransportConstants.HOST_PROP_NAME, hornetq_host);  
       map.put(TransportConstants.PORT_PROP_NAME, hornetq_port);
	TransportConfiguration transportConfiguration =new TransportConfiguration(
			NettyConnectorFactory.class.getName(), map);
	
	HornetQConnectionFactory hornetQConnectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(
			JMSFactoryType.CF, transportConfiguration);
	
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory((ConnectionFactory) hornetQConnectionFactory);
	container.setDestination(HornetQJMSClient.createTopic(IMConstant.GATEWAY_USERREGISTER_TOPIC));
	container.setPubSubDomain(true);
	container.setPubSubNoLocal(true);
	container.setMessageListener(userRegisterListener);
	container.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
	return container;
}
 
开发者ID:projectsrepos,项目名称:jim,代码行数:21,代码来源:GatewayUserRegisterConfig.java

示例8: mockServerListener

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public MessageListenerContainer mockServerListener(ActiveMQConnectionFactory connectionFactory) {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(connectionFactory);
  container.setDestination(new ActiveMQQueue("c2mon.client.request"));
  container.setMessageListener((SessionAwareMessageListener) (message, session) -> {
    session.createProducer(message.getJMSReplyTo()).send(session.createTextMessage("[]"));
  });
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:11,代码来源:MockServerConfig.java

示例9: requestJmsContainer

import org.springframework.jms.listener.DefaultMessageListenerContainer; //导入方法依赖的package包/类
@Bean
public DefaultMessageListenerContainer requestJmsContainer(ProcessRequestHandlerImpl processRequestHandler) {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(daqInConnectionFactory());
  container.setDestination(new ActiveMQQueue(properties.getJms().getQueuePrefix() + ".request"));
  container.setMessageListener(processRequestHandler);
  container.setConcurrentConsumers(properties.getJms().getRequest().getInitialConsumers());
  container.setMaxConcurrentConsumers(properties.getJms().getRequest().getMaxConsumers());
  container.setSessionTransacted(properties.getJms().getRequest().isTransacted());
  container.setPhase(ServerConstants.PHASE_START_LAST);
  container.setBeanName("Process request JMS container");
  return container;
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:14,代码来源:DaqJmsConfig.java


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