File tree 1 file changed +11
-1
lines changed
spring-jms/src/main/java/org/springframework/jms/config
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
23
23
import org .springframework .jms .listener .endpoint .JmsActivationSpecConfig ;
24
24
import org .springframework .jms .listener .endpoint .JmsMessageEndpointManager ;
25
25
import org .springframework .lang .Nullable ;
26
+ import org .springframework .util .StringUtils ;
26
27
27
28
/**
28
29
* Base model for a JMS listener endpoint.
@@ -50,10 +51,16 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
50
51
private String concurrency ;
51
52
52
53
54
+ /**
55
+ * Set a custom id for this endpoint.
56
+ */
53
57
public void setId (String id ) {
54
58
this .id = id ;
55
59
}
56
60
61
+ /**
62
+ * Return the id of this endpoint (possibly generated).
63
+ */
57
64
@ Override
58
65
public String getId () {
59
66
return this .id ;
@@ -136,6 +143,9 @@ public void setupListenerContainer(MessageListenerContainer listenerContainer) {
136
143
}
137
144
138
145
private void setupJmsListenerContainer (AbstractMessageListenerContainer listenerContainer ) {
146
+ if (StringUtils .hasText (getId ())) {
147
+ listenerContainer .setBeanName (getId ());
148
+ }
139
149
if (getDestination () != null ) {
140
150
listenerContainer .setDestinationName (getDestination ());
141
151
}
You can’t perform that action at this time.
0 commit comments