Skip to content

Error handling for destination with ':' character #1497

@b-dzoba

Description

@b-dzoba

I tried to use @serviceactivator annotation for error handling as described in reference guide, but it doesn't seem to work when RabbitMQ exchange name contains colon character. Application fails to start with an exception:

org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [my:destination.myGroup.errors] with key 'org.springframework.integration:type=MessageChannel,name=my:destination.myGroup.errors'; nested exception is javax.management.MalformedObjectNameException: Invalid character `:' in value 

What is the correct way to register error handler in this case?

Sample code and properties:

@SpringBootApplication @EnableBinding(Sink.class) public class DemoApplication {	public static void main(String[] args) {	SpringApplication.run(DemoApplication.class, args);	}	@StreamListener(Sink.INPUT)	public void handle(Object value) {	throw new RuntimeException("BOOM!");	}	@ServiceActivator(inputChannel = "my:destination.myGroup.errors")	public void error(Message<?> message) {	System.out.println("Handling ERROR: " + message);	} } 

spring.cloud.stream.bindings.input.destination=my:destination
spring.cloud.stream.bindings.input.group=myGroup

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions