Skip to content

Commit 45fe5be

Browse files
amitsadafuleartembilan
authored andcommitted
GH-2956: Add MessageHandler.getMetricsCaptor()
Fixes #2956 * Add `getMetricsCaptor.getMetricsCaptor()` for possible customization in the target implementation * Added dependancy for `@Nullable` **Cherry-pick to 5.1.x**
1 parent 78a0ec7 commit 45fe5be

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandler.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.springframework.integration.support.management.metrics.SampleFacade;
3636
import org.springframework.integration.support.management.metrics.TimerFacade;
3737
import org.springframework.integration.support.utils.IntegrationUtils;
38+
import org.springframework.lang.Nullable;
3839
import org.springframework.messaging.Message;
3940
import org.springframework.messaging.MessageHandler;
4041
import org.springframework.util.Assert;
@@ -51,6 +52,7 @@
5152
* @author Oleg Zhurakousky
5253
* @author Gary Russell
5354
* @author Artem Bilan
55+
* @author Amit Sadafule
5456
*/
5557
@SuppressWarnings("deprecation")
5658
@IntegrationManagedResource
@@ -100,6 +102,11 @@ public void registerMetricsCaptor(MetricsCaptor metricsCaptorToRegister) {
100102
this.metricsCaptor = metricsCaptorToRegister;
101103
}
102104

105+
@Nullable
106+
protected MetricsCaptor getMetricsCaptor() {
107+
return this.metricsCaptor;
108+
}
109+
103110
@Override
104111
public void setOrder(int order) {
105112
this.order = order;

0 commit comments

Comments
 (0)