@Test public void shouldCreateRegularConsumerEndpoint() { given(mockConsumerProperties.getMaxAttempts()).willReturn(1); ArtemisConsumerDestination destination = new ArtemisConsumerDestination("test-destination"); MessageProducer producer = binder.createConsumerEndpoint(destination, "test-group", mockConsumerProperties); assertThat(producer).isInstanceOf(JmsMessageDrivenEndpoint.class); JmsMessageDrivenEndpoint endpoint = (JmsMessageDrivenEndpoint) producer; assertThat(endpoint.getListener()).isNotInstanceOf(RetryableChannelPublishingJmsMessageListener.class); }
@Override protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group, ExtendedConsumerProperties<ArtemisConsumerProperties> properties) { logger.debug("Creating consumer endpoint for '{" + destination + "}' with a group '{" + group + "}'"); if (!StringUtils.hasText(group)) { group = getAnonymousGroupName(); } String subscriptionName = getQueueName(destination.getName(), group); ListenerContainerFactory listenerContainerFactory = new ListenerContainerFactory(connectionFactory); AbstractMessageListenerContainer listenerContainer = listenerContainerFactory .getListenerContainer(destination.getName(), subscriptionName); if (properties.getMaxAttempts() == 1) { return Jms.messageDrivenChannelAdapter(listenerContainer).get(); } RetryTemplate retryTemplate = buildRetryTemplate(properties); ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, group, properties); RetryableChannelPublishingJmsMessageListener listener = new RetryableChannelPublishingJmsMessageListener(retryTemplate, errorInfrastructure.getRecoverer()); listener.setExpectReply(false); return new JmsMessageDrivenEndpoint(listenerContainer, listener); }
ArtemisMessageChannelBinder extends
        AbstractMessageChannelBinder<ExtendedConsumerProperties<ArtemisConsumerProperties>,
                ExtendedProducerProperties<ArtemisProducerProperties>, ArtemisProvisioningProvider> implements ExtendedPropertiesBinder<MessageChannel, ArtemisConsumerProperties, ArtemisProducerProperties> { @Override protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group, ExtendedConsumerProperties<ArtemisConsumerProperties> properties) { logger.debug("Creating consumer endpoint for '{" + destination + "}' with a group '{" + group + "}'"); if (!StringUtils.hasText(group)) { group = getAnonymousGroupName(); } String subscriptionName = getQueueName(destination.getName(), group); ListenerContainerFactory listenerContainerFactory = new ListenerContainerFactory(connectionFactory); AbstractMessageListenerContainer listenerContainer = listenerContainerFactory .getListenerContainer(destination.getName(), subscriptionName); if (properties.getMaxAttempts() == 1) { return Jms.messageDrivenChannelAdapter(listenerContainer).get(); } RetryTemplate retryTemplate = buildRetryTemplate(properties); ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, group, properties); RetryableChannelPublishingJmsMessageListener listener = new RetryableChannelPublishingJmsMessageListener(retryTemplate, errorInfrastructure.getRecoverer()); listener.setExpectReply(false); return new JmsMessageDrivenEndpoint(listenerContainer, listener); } }
ArtemisMessageChannelBinder extends
        AbstractMessageChannelBinder<ExtendedConsumerProperties<ArtemisConsumerProperties>,
                ExtendedProducerProperties<ArtemisProducerProperties>, ArtemisProvisioningProvider> implements ExtendedPropertiesBinder<MessageChannel, ArtemisConsumerProperties, ArtemisProducerProperties> { @Override protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group, ExtendedConsumerProperties<ArtemisConsumerProperties> properties) { logger.debug("Creating consumer endpoint for '{" + destination + "}' with a group '{" + group + "}'"); if (!StringUtils.hasText(group)) { group = getAnonymousGroupName(); } String subscriptionName = getQueueName(destination.getName(), group); ListenerContainerFactory listenerContainerFactory = new ListenerContainerFactory(connectionFactory); AbstractMessageListenerContainer listenerContainer = listenerContainerFactory .getListenerContainer(destination.getName(), subscriptionName); if (properties.getMaxAttempts() == 1) { return Jms.messageDrivenChannelAdapter(listenerContainer).get(); } RetryTemplate retryTemplate = buildRetryTemplate(properties); ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, group, properties); RetryableChannelPublishingJmsMessageListener listener = new RetryableChannelPublishingJmsMessageListener(retryTemplate, errorInfrastructure.getRecoverer()); listener.setExpectReply(false); return new JmsMessageDrivenEndpoint(listenerContainer, listener); } ArtemisMessageChannelBinder(ArtemisProvisioningProvider provisioningProvider,
            ConnectionFactory connectionFactory, ArtemisExtendedBindingProperties bindingProperties); }
ArtemisMessageChannelBinder extends
        AbstractMessageChannelBinder<ExtendedConsumerProperties<ArtemisConsumerProperties>,
                ExtendedProducerProperties<ArtemisProducerProperties>, ArtemisProvisioningProvider> implements ExtendedPropertiesBinder<MessageChannel, ArtemisConsumerProperties, ArtemisProducerProperties> { @Override protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group, ExtendedConsumerProperties<ArtemisConsumerProperties> properties) { logger.debug("Creating consumer endpoint for '{" + destination + "}' with a group '{" + group + "}'"); if (!StringUtils.hasText(group)) { group = getAnonymousGroupName(); } String subscriptionName = getQueueName(destination.getName(), group); ListenerContainerFactory listenerContainerFactory = new ListenerContainerFactory(connectionFactory); AbstractMessageListenerContainer listenerContainer = listenerContainerFactory .getListenerContainer(destination.getName(), subscriptionName); if (properties.getMaxAttempts() == 1) { return Jms.messageDrivenChannelAdapter(listenerContainer).get(); } RetryTemplate retryTemplate = buildRetryTemplate(properties); ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, group, properties); RetryableChannelPublishingJmsMessageListener listener = new RetryableChannelPublishingJmsMessageListener(retryTemplate, errorInfrastructure.getRecoverer()); listener.setExpectReply(false); return new JmsMessageDrivenEndpoint(listenerContainer, listener); } ArtemisMessageChannelBinder(ArtemisProvisioningProvider provisioningProvider,
            ConnectionFactory connectionFactory, ArtemisExtendedBindingProperties bindingProperties); @Override ArtemisConsumerProperties getExtendedConsumerProperties(String channelName); @Override ArtemisProducerProperties getExtendedProducerProperties(String channelName); @Override String getDefaultsPrefix(); @Override Class<? extends BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass(); }
ArtemisMessageChannelBinder extends
        AbstractMessageChannelBinder<ExtendedConsumerProperties<ArtemisConsumerProperties>,
                ExtendedProducerProperties<ArtemisProducerProperties>, ArtemisProvisioningProvider> implements ExtendedPropertiesBinder<MessageChannel, ArtemisConsumerProperties, ArtemisProducerProperties> { @Override protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group, ExtendedConsumerProperties<ArtemisConsumerProperties> properties) { logger.debug("Creating consumer endpoint for '{" + destination + "}' with a group '{" + group + "}'"); if (!StringUtils.hasText(group)) { group = getAnonymousGroupName(); } String subscriptionName = getQueueName(destination.getName(), group); ListenerContainerFactory listenerContainerFactory = new ListenerContainerFactory(connectionFactory); AbstractMessageListenerContainer listenerContainer = listenerContainerFactory .getListenerContainer(destination.getName(), subscriptionName); if (properties.getMaxAttempts() == 1) { return Jms.messageDrivenChannelAdapter(listenerContainer).get(); } RetryTemplate retryTemplate = buildRetryTemplate(properties); ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, group, properties); RetryableChannelPublishingJmsMessageListener listener = new RetryableChannelPublishingJmsMessageListener(retryTemplate, errorInfrastructure.getRecoverer()); listener.setExpectReply(false); return new JmsMessageDrivenEndpoint(listenerContainer, listener); } ArtemisMessageChannelBinder(ArtemisProvisioningProvider provisioningProvider,
            ConnectionFactory connectionFactory, ArtemisExtendedBindingProperties bindingProperties); @Override ArtemisConsumerProperties getExtendedConsumerProperties(String channelName); @Override ArtemisProducerProperties getExtendedProducerProperties(String channelName); @Override String getDefaultsPrefix(); @Override Class<? extends BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass();  }