File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
spring-jms/src/main/java/org/springframework/jms/config Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2018 the original author or authors.
2+ * Copyright 2002-2021 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2323import org .springframework .jms .listener .endpoint .JmsActivationSpecConfig ;
2424import org .springframework .jms .listener .endpoint .JmsMessageEndpointManager ;
2525import org .springframework .lang .Nullable ;
26+ import org .springframework .util .StringUtils ;
2627
2728/**
2829 * Base model for a JMS listener endpoint.
@@ -50,10 +51,16 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
5051 private String concurrency ;
5152
5253
54+ /**
55+ * Set a custom id for this endpoint.
56+ */
5357 public void setId (String id ) {
5458 this .id = id ;
5559 }
5660
61+ /**
62+ * Return the id of this endpoint (possibly generated).
63+ */
5764 @ Override
5865 public String getId () {
5966 return this .id ;
@@ -136,6 +143,9 @@ public void setupListenerContainer(MessageListenerContainer listenerContainer) {
136143 }
137144
138145 private void setupJmsListenerContainer (AbstractMessageListenerContainer listenerContainer ) {
146+ if (StringUtils .hasText (getId ())) {
147+ listenerContainer .setBeanName (getId ());
148+ }
139149 if (getDestination () != null ) {
140150 listenerContainer .setDestinationName (getDestination ());
141151 }
You can’t perform that action at this time.
0 commit comments