Java Code Examples for org.springframework.jms.listener.DefaultMessageListenerContainer#setRecoveryInterval()
The following examples show how to use
org.springframework.jms.listener.DefaultMessageListenerContainer#setRecoveryInterval() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultJmsListenerContainerFactory.java From spring-analysis-note with MIT License | 5 votes |
@Override protected void initializeContainer(DefaultMessageListenerContainer container) { if (this.taskExecutor != null) { container.setTaskExecutor(this.taskExecutor); } if (this.transactionManager != null) { container.setTransactionManager(this.transactionManager); } if (this.cacheLevel != null) { container.setCacheLevel(this.cacheLevel); } else if (this.cacheLevelName != null) { container.setCacheLevelName(this.cacheLevelName); } if (this.concurrency != null) { container.setConcurrency(this.concurrency); } if (this.maxMessagesPerTask != null) { container.setMaxMessagesPerTask(this.maxMessagesPerTask); } if (this.receiveTimeout != null) { container.setReceiveTimeout(this.receiveTimeout); } if (this.backOff != null) { container.setBackOff(this.backOff); if (this.recoveryInterval != null) { logger.info("Ignoring recovery interval in DefaultJmsListenerContainerFactory in favor of BackOff"); } } else if (this.recoveryInterval != null) { container.setRecoveryInterval(this.recoveryInterval); } }
Example 2
Source File: DefaultJmsListenerContainerFactory.java From java-technology-stack with MIT License | 5 votes |
@Override protected void initializeContainer(DefaultMessageListenerContainer container) { if (this.taskExecutor != null) { container.setTaskExecutor(this.taskExecutor); } if (this.transactionManager != null) { container.setTransactionManager(this.transactionManager); } if (this.cacheLevel != null) { container.setCacheLevel(this.cacheLevel); } else if (this.cacheLevelName != null) { container.setCacheLevelName(this.cacheLevelName); } if (this.concurrency != null) { container.setConcurrency(this.concurrency); } if (this.maxMessagesPerTask != null) { container.setMaxMessagesPerTask(this.maxMessagesPerTask); } if (this.receiveTimeout != null) { container.setReceiveTimeout(this.receiveTimeout); } if (this.backOff != null) { container.setBackOff(this.backOff); if (this.recoveryInterval != null) { logger.info("Ignoring recovery interval in DefaultJmsListenerContainerFactory in favor of BackOff"); } } else if (this.recoveryInterval != null) { container.setRecoveryInterval(this.recoveryInterval); } }
Example 3
Source File: DefaultJmsListenerContainerFactory.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Override protected void initializeContainer(DefaultMessageListenerContainer container) { if (this.taskExecutor != null) { container.setTaskExecutor(this.taskExecutor); } if (this.transactionManager != null) { container.setTransactionManager(this.transactionManager); } if (this.cacheLevel != null) { container.setCacheLevel(this.cacheLevel); } else if (this.cacheLevelName != null) { container.setCacheLevelName(this.cacheLevelName); } if (this.concurrency != null) { container.setConcurrency(this.concurrency); } if (this.maxMessagesPerTask != null) { container.setMaxMessagesPerTask(this.maxMessagesPerTask); } if (this.receiveTimeout != null) { container.setReceiveTimeout(this.receiveTimeout); } if (this.backOff != null) { container.setBackOff(this.backOff); if (this.recoveryInterval != null) { logger.warn("Ignoring recovery interval in DefaultJmsListenerContainerFactory in favor of BackOff"); } } else if (this.recoveryInterval != null) { container.setRecoveryInterval(this.recoveryInterval); } }
Example 4
Source File: MQHierachy.java From Thunder with Apache License 2.0 | 5 votes |
public void listen(Destination destination, SessionAwareMessageListener<BytesMessage> messageListener, String requestSelector, boolean topic) throws Exception { int concurrentConsumers = mqPropertyEntity.getInteger(ThunderConstant.MQ_CONCURRENT_CONSUMERS_ATTRIBUTE_NAME); int maxConcurrentConsumers = mqPropertyEntity.getInteger(ThunderConstant.MQ_MAX_CONCURRENT_CONSUMERS_ATTRIBUTE_NAME); long receiveTimeout = mqPropertyEntity.getLong(ThunderConstant.MQ_RECEIVE_TIMEOUT_ATTRIBUTE_NAME); long recoveryInterval = mqPropertyEntity.getLong(ThunderConstant.MQ_RECOVERY_INTERVAL_ATTRIBUTE_NAME); int idleConsumerLimit = mqPropertyEntity.getInteger(ThunderConstant.MQ_IDLE_CONSUMER_LIMIT_ATTRIBUTE_NAME); int idleTaskExecutionLimit = mqPropertyEntity.getInteger(ThunderConstant.MQ_IDLE_TASK_EXECUTION_LIMIT_ATTRIBUTE_NAME); int cacheLevel = mqPropertyEntity.getInteger(ThunderConstant.MQ_CACHE_LEVEL_ATTRIBUTE_NAME); boolean acceptMessagesWhileStopping = mqPropertyEntity.getBoolean(ThunderConstant.MQ_ACCEPT_MESSAGES_WHILE_STOPPING_ATTRIBUTE_NAME); MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter(); messageListenerAdapter.setDelegate(messageListener); DefaultMessageListenerContainer messageListenerContainer = new DefaultMessageListenerContainer(); messageListenerContainer.setDestination(destination); messageListenerContainer.setConnectionFactory(connectionFactory); messageListenerContainer.setMessageListener(messageListenerAdapter); if (StringUtils.isNotEmpty(requestSelector)) { messageListenerContainer.setMessageSelector(SelectorType.REQUEST_SELECTOR + " = '" + requestSelector + "'"); } messageListenerContainer.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE); messageListenerContainer.setPubSubDomain(topic); messageListenerContainer.setConcurrentConsumers(topic ? 1 : concurrentConsumers); messageListenerContainer.setMaxConcurrentConsumers(topic ? 1 : maxConcurrentConsumers); messageListenerContainer.setReceiveTimeout(receiveTimeout); messageListenerContainer.setRecoveryInterval(recoveryInterval); messageListenerContainer.setIdleConsumerLimit(idleConsumerLimit); messageListenerContainer.setIdleTaskExecutionLimit(idleTaskExecutionLimit); messageListenerContainer.setCacheLevel(cacheLevel); messageListenerContainer.setAcceptMessagesWhileStopping(acceptMessagesWhileStopping); messageListenerContainer.afterPropertiesSet(); messageListenerContainer.start(); }