Skip to content

Commit 2afe115

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** (cherry picked from commit 45fe5be)
1 parent cebfe8a commit 2afe115

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.springframework.integration.support.management.metrics.SampleFacade;
3838
import org.springframework.integration.support.management.metrics.TimerFacade;
3939
import org.springframework.integration.support.utils.IntegrationUtils;
40+
import org.springframework.lang.Nullable;
4041
import org.springframework.messaging.Message;
4142
import org.springframework.messaging.MessageHandler;
4243
import org.springframework.util.Assert;
@@ -53,6 +54,7 @@
5354
* @author Oleg Zhurakousky
5455
* @author Gary Russell
5556
* @author Artem Bilan
57+
* @author Amit Sadafule
5658
*/
5759
@IntegrationManagedResource
5860
public abstract class AbstractMessageHandler extends IntegrationObjectSupport
@@ -99,6 +101,11 @@ public void registerMetricsCaptor(MetricsCaptor metricsCaptor) {
99101
this.metricsCaptor = metricsCaptor;
100102
}
101103

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

0 commit comments

Comments
 (0)