@Override protected void onInit() { if (this.retryTemplate != null) { Assert.state(getErrorChannel() == null, "Cannot have an 'errorChannel' property when a 'RetryTemplate' is " + "provided; use an 'ErrorMessageSendingRecoverer' in the 'recoveryCallback' property to " + "send an error message when retries are exhausted"); } Listener messageListener = new Listener(); this.messageListenerContainer.setMessageListener(messageListener); this.messageListenerContainer.afterPropertiesSet(); super.onInit(); }
@Override protected void onInit() { if (this.retryTemplate != null) { Assert.state(getErrorChannel() == null, "Cannot have an 'errorChannel' property when a 'RetryTemplate' is " + "provided; use an 'ErrorMessageSendingRecoverer' in the 'recoveryCallback' property to " + "send an error message when retries are exhausted"); } Listener messageListener = new Listener(); this.messageListenerContainer.setMessageListener(messageListener); this.messageListenerContainer.afterPropertiesSet(); if (!this.amqpTemplateExplicitlySet) { ((RabbitTemplate) this.amqpTemplate).afterPropertiesSet(); } super.onInit(); if (this.retryTemplate != null && getErrorChannel() != null) { logger.warn("Usually, when using a RetryTemplate you should use an ErrorMessageSendingRecoverer and not " + "provide an errorChannel. Using an errorChannel could defeat retry and will receive an error " + "message for each delivery attempt."); } }
@Override public void onInit() { super.onInit(); this.dispatcher = this.createDispatcher(); if (this.maxSubscribers == null) { this.maxSubscribers = this.getIntegrationProperty(this.isPubSub ? IntegrationProperties.CHANNELS_MAX_BROADCAST_SUBSCRIBERS : IntegrationProperties.CHANNELS_MAX_UNICAST_SUBSCRIBERS, Integer.class); } setMaxSubscribers(this.maxSubscribers); String queue = obtainQueueName(this.channelName); this.container.setQueueNames(queue); MessageConverter converter = (this.getAmqpTemplate() instanceof RabbitTemplate) ? ((RabbitTemplate) this.getAmqpTemplate()).getMessageConverter() : new SimpleMessageConverter(); MessageListener listener = new DispatchingMessageListener(converter, this.dispatcher, this, this.isPubSub, getMessageBuilderFactory(), getInboundHeaderMapper()); this.container.setMessageListener(listener); if (!this.container.isActive()) { this.container.afterPropertiesSet(); } }
@Override protected void onInit() { if (this.retryTemplate != null) { Assert.state(getErrorChannel() == null, "Cannot have an 'errorChannel' property when a 'RetryTemplate' is " + "provided; use an 'ErrorMessageSendingRecoverer' in the 'recoveryCallback' property to " + "send an error message when retries are exhausted"); } Listener messageListener = new Listener(); this.messageListenerContainer.setMessageListener(messageListener); this.messageListenerContainer.afterPropertiesSet(); super.onInit(); }
this.container.setQueueNames(replyQueue); this.container.setMessageListener(this); this.container.afterPropertiesSet(); this.directReplyToContainer = null; if (replyAddress == null) {
/** * Start this container. * @see #doStart */ @Override public void start() { if (isRunning()) { return; } if (!this.initialized) { synchronized (this.lifecycleMonitor) { if (!this.initialized) { afterPropertiesSet(); } } } try { if (logger.isDebugEnabled()) { logger.debug("Starting Rabbit listener container."); } configureAdminIfNeeded(); checkMismatchedQueues(); doStart(); } catch (Exception ex) { throw convertRabbitAccessException(ex); } }
@Override protected void onInit() { if (this.retryTemplate != null) { Assert.state(getErrorChannel() == null, "Cannot have an 'errorChannel' property when a 'RetryTemplate' is " + "provided; use an 'ErrorMessageSendingRecoverer' in the 'recoveryCallback' property to " + "send an error message when retries are exhausted"); } Listener messageListener = new Listener(); this.messageListenerContainer.setMessageListener(messageListener); this.messageListenerContainer.afterPropertiesSet(); if (!this.amqpTemplateExplicitlySet) { ((RabbitTemplate) this.amqpTemplate).afterPropertiesSet(); } super.onInit(); if (this.retryTemplate != null && getErrorChannel() != null) { logger.warn("Usually, when using a RetryTemplate you should use an ErrorMessageSendingRecoverer and not " + "provide an errorChannel. Using an errorChannel could defeat retry and will receive an error " + "message for each delivery attempt."); } }
/** * Start this container. * @see #doStart */ @Override public void start() { if (isRunning()) { return; } if (!this.initialized) { synchronized (this.lifecycleMonitor) { if (!this.initialized) { afterPropertiesSet(); } } } try { if (logger.isDebugEnabled()) { logger.debug("Starting Rabbit listener container."); } configureAdminIfNeeded(); checkMismatchedQueues(); doStart(); } catch (Exception ex) { throw convertRabbitAccessException(ex); } }
this.container.setQueueNames(replyQueue); this.container.setMessageListener(this); this.container.afterPropertiesSet(); this.directReplyToContainer = null; if (replyAddress == null) {
container.setExposeListenerChannel(false); container.setShutdownTimeout(100); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setShutdownTimeout(100); container.setTransactionManager(new RabbitTransactionManager(cachingConnectionFactory)); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setChannelTransacted(true); container.setShutdownTimeout(100); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setChannelTransacted(true); container.setShutdownTimeout(100); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setShutdownTimeout(100); container.setTransactionManager(new DummyTxManager()); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setChannelTransacted(true); container.setShutdownTimeout(100); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setChannelTransacted(true); container.setShutdownTimeout(100); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setShutdownTimeout(100); container.setTransactionManager(new DummyTxManager()); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setShutdownTimeout(100); container.setTransactionManager(new DummyTxManager()); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
container.setShutdownTimeout(100); container.setTransactionManager(new DummyTxManager()); container.afterPropertiesSet(); container.start(); assertTrue(consumerLatch.await(10, TimeUnit.SECONDS));
@Override public void onInit() { super.onInit(); this.dispatcher = this.createDispatcher(); if (this.maxSubscribers == null) { this.maxSubscribers = this.getIntegrationProperty(this.isPubSub ? IntegrationProperties.CHANNELS_MAX_BROADCAST_SUBSCRIBERS : IntegrationProperties.CHANNELS_MAX_UNICAST_SUBSCRIBERS, Integer.class); } setMaxSubscribers(this.maxSubscribers); String queue = obtainQueueName(this.channelName); this.container.setQueueNames(queue); MessageConverter converter = (this.getAmqpTemplate() instanceof RabbitTemplate) ? ((RabbitTemplate) this.getAmqpTemplate()).getMessageConverter() : new SimpleMessageConverter(); MessageListener listener = new DispatchingMessageListener(converter, this.dispatcher, this, this.isPubSub, getMessageBuilderFactory(), getInboundHeaderMapper()); this.container.setMessageListener(listener); if (!this.container.isActive()) { this.container.afterPropertiesSet(); } }