/** * Check whether the given Channel is locally transacted, that is, whether its transaction is managed by this * listener container's Channel handling and not by an external transaction coordinator. * <p> * Note:This method is about finding out whether the Channel's transaction is local or externally coordinated. * @return whether the given Channel is locally transacted * @see #isChannelTransacted() */ protected boolean isChannelLocallyTransacted() { return this.isChannelTransacted() && this.transactionManager == null; }
/** * Check whether the given Channel is locally transacted, that is, whether its transaction is managed by this * listener container's Channel handling and not by an external transaction coordinator. * <p> * Note:This method is about finding out whether the Channel's transaction is local or externally coordinated. * @return whether the given Channel is locally transacted * @see #isChannelTransacted() */ protected boolean isChannelLocallyTransacted() { return this.isChannelTransacted() && this.transactionManager == null; }
/** * Delegates to {@link #validateConfiguration()} and {@link #initialize()}. */ @Override public final void afterPropertiesSet() { super.afterPropertiesSet(); Assert.state( this.exposeListenerChannel || !getAcknowledgeMode().isManual(), "You cannot acknowledge messages manually if the channel is not exposed to the listener " + "(please check your configuration and set exposeListenerChannel=true or acknowledgeMode!=MANUAL)"); Assert.state( !(getAcknowledgeMode().isAutoAck() && isChannelTransacted()), "The acknowledgeMode is NONE (autoack in Rabbit terms) which is not consistent with having a " + "transactional channel. Either use a different AcknowledgeMode or make sure channelTransacted=false"); validateConfiguration(); initialize(); }
/** * Delegates to {@link #validateConfiguration()} and {@link #initialize()}. */ @Override public final void afterPropertiesSet() { super.afterPropertiesSet(); Assert.state( this.exposeListenerChannel || !getAcknowledgeMode().isManual(), "You cannot acknowledge messages manually if the channel is not exposed to the listener " + "(please check your configuration and set exposeListenerChannel=true or acknowledgeMode!=MANUAL)"); Assert.state( !(getAcknowledgeMode().isAutoAck() && isChannelTransacted()), "The acknowledgeMode is NONE (autoack in Rabbit terms) which is not consistent with having a " + "transactional channel. Either use a different AcknowledgeMode or make sure channelTransacted=false"); validateConfiguration(); initialize(); }
this.taskExecutorSet = true; if (this.transactionManager != null && !isChannelTransacted()) { logger.debug("The 'channelTransacted' is coerced to 'true', when 'transactionManager' is provided"); setChannelTransacted(true);
this.taskExecutorSet = true; if (this.transactionManager != null && !isChannelTransacted()) { logger.debug("The 'channelTransacted' is coerced to 'true', when 'transactionManager' is provided"); setChannelTransacted(true);
private void assertBasicConfig(AbstractMessageListenerContainer container) { DirectFieldAccessor fieldAccessor = new DirectFieldAccessor(container); assertSame(connectionFactory, container.getConnectionFactory()); assertSame(errorHandler, fieldAccessor.getPropertyValue("errorHandler")); assertSame(messageConverter, fieldAccessor.getPropertyValue("messageListener.messageConverter")); assertEquals(AcknowledgeMode.MANUAL, container.getAcknowledgeMode()); assertEquals(true, container.isChannelTransacted()); assertEquals(false, container.isAutoStartup()); assertEquals(99, container.getPhase()); }