{"record":{"id":"e45d826d8359c13f","repo":"flowable/flowable-engine","slug":"could-not-resolve-the-rabbitlistenercontainerfacto","errorCode":null,"errorMessage":"Could not resolve the RabbitListenerContainerFactory to use for [{endpoint}] no factory was given and no default is set.","messagePattern":"Could not resolve the RabbitListenerContainerFactory to use for \\[(.+?)\\] no factory was given and no default is set\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/rabbit/RabbitChannelDefinitionProcessor.java","lineNumber":351,"sourceCode":"        // This also makes sure that we are not going to start our listener earlier than the RabbitListenerEndpointRegistry\n        boolean startImmediately = contextRefreshed || endpointRegistry.isRunning();\n        logger.info(\"Registering endpoint {} with start immediately {}\", endpoint, startImmediately);\n        endpointRegistry.registerListenerContainer(endpoint, resolveContainerFactory(endpoint, factory), startImmediately);\n        logger.info(\"Finished registering endpoint {}\", endpoint);\n    }\n\n    protected RabbitListenerContainerFactory<?> resolveContainerFactory(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> containerFactory) {\n        if (containerFactory != null) {\n            return containerFactory;\n        } else if (this.containerFactory != null) {\n            return this.containerFactory;\n        } else if (containerFactoryBeanName != null) {\n            Assert.state(beanFactory != null, \"BeanFactory must be set to obtain container factory by bean name\");\n            // Consider changing this if live change of the factory is required...\n            this.containerFactory = beanFactory.getBean(containerFactoryBeanName, RabbitListenerContainerFactory.class);\n            return this.containerFactory;\n        } else {\n            throw new IllegalStateException(\"Could not resolve the \" +\n                RabbitListenerContainerFactory.class.getSimpleName() + \" to use for [\" +\n                endpoint + \"] no factory was given and no default is set.\");\n        }\n    }\n\n    protected String getEndpointId(ChannelModel channelModel, String tenantId) {\n        String channelDefinitionKey = channelModel.getKey();\n        if (!StringUtils.hasText(tenantId)) {\n            return CHANNEL_ID_PREFIX + channelDefinitionKey;\n        }\n        return CHANNEL_ID_PREFIX + tenantId + \"#\" + channelDefinitionKey;\n    }\n\n    protected String resolve(String value) {\n        if (value == null) {\n            return null;\n        } else if (embeddedValueResolver != null) {\n            return embeddedValueResolver.resolveStringValue(value);","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/rabbit/RabbitChannelDefinitionProcessor.java#L333-L369","documentation":"Thrown by resolveContainerFactory when no RabbitListenerContainerFactory can be determined for a listener endpoint: no factory was set on the processor and no default factory bean exists. Copied from Spring AMQP's RabbitListenerAnnotationBeanPostProcessor behavior; registration cannot proceed without a factory.","triggerScenarios":"registerEndpoint called with neither a resolved containerFactory nor containerFactoryBeanName, and beanFactory lookup yields no default factory named RabbitListenerConfigUtils.DEFAULT_RABBIT_LISTENER_CONTAINER_FACTORY_BEAN_NAME.","commonSituations":"Missing @Configuration with RabbitListenerContainerFactory bean; custom Spring Boot auto-configuration disabled; containerFactoryBeanName typo; using the Flowable Rabbit channel processor without the standard spring-rabbit configuration.","solutions":["Define a RabbitListenerContainerFactory bean named 'rabbitListenerContainerFactory' in the Spring context","Set containerFactoryBeanName on the processor to point to an existing factory bean","Ensure a BeanFactory is set on the processor when resolving by bean name","Verify spring-rabbit is on the classpath and RabbitAutoConfiguration is not excluded"],"exampleFix":"// before\nRabbitChannelDefinitionProcessor p = new RabbitChannelDefinitionProcessor(); // no factory configured\n// after\n@Bean\npublic RabbitListenerContainerFactory<?> rabbitListenerContainerFactory(ConnectionFactory cf) {\n    SimpleRabbitListenerContainerFactory f = new SimpleRabbitListenerContainerFactory();\n    f.setConnectionFactory(cf);\n    return f;\n}","handlingStrategy":"validation","validationCode":"if (beanFactory == null || !beanFactory.containsBean(\"rabbitListenerContainerFactory\")) { throw new IllegalStateException(\"Define a RabbitListenerContainerFactory bean before registering rabbit channels\"); }","typeGuard":"boolean factoryAvailable = ctx.getBeanNamesForType(RabbitListenerContainerFactory.class).length > 0;","tryCatchPattern":"try { registerEndpoint(endpoint); } catch (IllegalStateException e) { log.error(\"No RabbitListenerContainerFactory configured: {}\", e.getMessage()); }","preventionTips":["Always define a 'rabbitListenerContainerFactory' bean when using Flowable Rabbit channels","Keep spring-rabbit on the classpath and auto-configuration enabled","Double-check containerFactoryBeanName spelling","Set the BeanFactory on the processor before use"],"tags":["rabbitmq","spring","configuration","missing-bean"],"backgroundTag":"missing-required-config","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}