@Override protected void onInit() { if (consumerProperties == null || !consumerProperties.getExtension().getEnabled()) { return; } super.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"); } this.consumer = consumersManager.getOrCreateConsumer(group, destination, consumerProperties); Boolean isOrderly = consumerProperties.getExtension().getOrderly(); this.listener = isOrderly ? new CloudStreamMessageListenerOrderly() : new CloudStreamMessageListenerConcurrently(); if (retryTemplate != null) { this.retryTemplate.registerListener(this.listener); } }
@Override protected void onInit() { super.onInit(); if (this.isClientMode) { Assert.notNull(this.clientConnectionFactory, "For client-mode, connection factory must be type='client'"); Assert.isTrue(!this.clientConnectionFactory.isSingleUse(), "For client-mode, connection factory must have single-use='false'"); } }
@Override protected void onInit() { super.onInit(); BeanFactory beanFactory = this.getBeanFactory(); if (this.xmppConnection == null && beanFactory != null) { this.xmppConnection = beanFactory.getBean(XmppContextUtils.XMPP_CONNECTION_BEAN_NAME, XMPPConnection.class); } Assert.notNull(this.xmppConnection, "Failed to resolve XMPPConnection. " + "XMPPConnection must either be set explicitly via constructor argument " + "or implicitly by registering a bean with the name 'xmppConnection' and of type " + "'org.jivesoftware.smack.XMPPConnection' in the Application Context."); this.initialized = true; }
@Override protected void onInit() { super.onInit(); if (!this.converterSet) { ((DefaultMessageConverter) this.converter).setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); this.webSocketContainer.setMessageListener(this); if (!CollectionUtils.isEmpty(this.messageConverters)) {
@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() { super.onInit(); if (this.converter == null) { DefaultPahoMessageConverter pahoMessageConverter = new DefaultPahoMessageConverter(); pahoMessageConverter.setBeanFactory(getBeanFactory()); this.converter = pahoMessageConverter; } }
@Override protected void onInit() { super.onInit(); this.listener.afterPropertiesSet(); if (!this.listenerContainer.isActive()) { this.listenerContainer.afterPropertiesSet(); } String sessionAckeMode = this.sessionAcknowledgeMode; if (sessionAckeMode == null && !this.externalContainer && DefaultMessageListenerContainer.class.isAssignableFrom(this.listenerContainer.getClass())) { sessionAckeMode = JmsAdapterUtils.SESSION_TRANSACTED_STRING; } Integer acknowledgeMode = JmsAdapterUtils.parseAcknowledgeMode(sessionAckeMode); if (acknowledgeMode != null) { if (JmsAdapterUtils.SESSION_TRANSACTED == acknowledgeMode) { this.listenerContainer.setSessionTransacted(true); } else { this.listenerContainer.setSessionAcknowledgeMode(acknowledgeMode); } } this.listener.setComponentName(this.getComponentName()); }
@Override protected void onInit() { super.onInit(); boolean hasTopics = false; if (this.topics != null) {
@Override protected void onInit() { super.onInit(); if (this.expectMessage) { Assert.notNull(this.serializer, "'serializer' has to be provided where 'expectMessage == true'."); } if (this.taskExecutor == null) { String beanName = this.getComponentName(); this.taskExecutor = new SimpleAsyncTaskExecutor((beanName == null ? "" : beanName + "-") + this.getComponentType()); } if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor) && this.getBeanFactory() != null) { MessagePublishingErrorHandler errorHandler = new MessagePublishingErrorHandler(new BeanFactoryChannelResolver(this.getBeanFactory())); errorHandler.setDefaultErrorChannel(this.errorChannel); this.taskExecutor = new ErrorHandlingTaskExecutor(this.taskExecutor, errorHandler); } }
@Override protected void onInit() { super.onInit(); if (this.isClientMode) { Assert.notNull(this.clientConnectionFactory, "For client-mode, connection factory must be type='client'"); Assert.isTrue(!this.clientConnectionFactory.isSingleUse(), "For client-mode, connection factory must have single-use='false'"); } }
@Override protected void onInit() { super.onInit(); BeanFactory beanFactory = this.getBeanFactory(); if (this.xmppConnection == null && beanFactory != null) { this.xmppConnection = beanFactory.getBean(XmppContextUtils.XMPP_CONNECTION_BEAN_NAME, XMPPConnection.class); } Assert.notNull(this.xmppConnection, "Failed to resolve XMPPConnection. " + "XMPPConnection must either be set explicitly via constructor argument " + "or implicitly by registering a bean with the name 'xmppConnection' and of type " + "'org.jivesoftware.smack.XMPPConnection' in the Application Context."); this.initialized = true; }
@Override protected void onInit() { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); if (!this.converterSet) { ((DefaultMessageConverter) this.converter).setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); this.server = (NetServer)this.spec.consumeInput(new Consumer() { @Override public void accept(Object o) { sendMessage(new GenericMessage<Object>(o)); } }).get(); }
@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() { super.onInit(); this.listenerContainer = this.simpleMessageListenerContainerFactory.createSimpleMessageListenerContainer(); if (this.queueStopTimeout != null) { this.listenerContainer.setQueueStopTimeout(this.queueStopTimeout); } this.listenerContainer.setMessageHandler(new IntegrationQueueMessageHandler()); try { this.listenerContainer.afterPropertiesSet(); } catch (Exception e) { throw new BeanCreationException("Cannot instantiate 'SimpleMessageListenerContainer'", e); } }
@Override protected void onInit() { super.onInit(); this.listenerContainer = this.simpleMessageListenerContainerFactory.createSimpleMessageListenerContainer(); if (this.queueStopTimeout != null) { this.listenerContainer.setQueueStopTimeout(this.queueStopTimeout); } this.listenerContainer.setMessageHandler(new IntegrationQueueMessageHandler()); try { this.listenerContainer.afterPropertiesSet(); } catch (Exception e) { throw new BeanCreationException("Cannot instantiate 'SimpleMessageListenerContainer'", e); } }
@Override protected void onInit() { super.onInit(); if (this.expectMessage) { Assert.notNull(this.serializer, "'serializer' has to be provided where 'expectMessage == true'."); } if (this.taskExecutor == null) { String beanName = this.getComponentName(); this.taskExecutor = new SimpleAsyncTaskExecutor((beanName == null ? "" : beanName + "-") + this.getComponentType()); } if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor) && this.getBeanFactory() != null) { MessagePublishingErrorHandler errorHandler = new MessagePublishingErrorHandler(new BeanFactoryChannelResolver(this.getBeanFactory())); errorHandler.setDefaultErrorChannel(this.errorChannel); this.taskExecutor = new ErrorHandlingTaskExecutor(this.taskExecutor, errorHandler); } }