INT-3831: Fix MessagingGatewaySupport MBean Export

JIRA: https://jira.spring.io/browse/INT-3831

- Add `@IntegrationManagedResource`
- Suppress exporting as an endpoint

Fix `outputChannel` issue for anonymous `MessagingGatewaySupport`

INT-3831: Pure JavaConfig Test

INT-3831: Polishing

Check output channel name for anonymous message source metrics.

Don't use getter on MGS to avoid early channel resolution.

INT-3831: Fix Test - Avoid Second MBeanServer

Reference the `MBSFB` in the context rather than create a new `MBeanServer`.

Polishing
This commit is contained in:
Gary Russell
2015-10-23 15:24:38 -04:00
committed by Artem Bilan
parent 1012e588e4
commit 37aaa82272
9 changed files with 169 additions and 19 deletions

View File

@@ -225,4 +225,9 @@ public class NullChannel implements PollableChannel, MessageChannelMetrics,
return this.receive();
}
@Override
public String toString() {
return (this.beanName != null) ? this.beanName : super.toString();
}
}

View File

@@ -30,6 +30,7 @@ import org.springframework.integration.mapping.OutboundMessageMapper;
import org.springframework.integration.support.DefaultMessageBuilderFactory;
import org.springframework.integration.support.MessageBuilderFactory;
import org.springframework.integration.support.converter.SimpleMessageConverter;
import org.springframework.integration.support.management.IntegrationManagedResource;
import org.springframework.integration.support.management.MessageSourceMetrics;
import org.springframework.integration.support.management.TrackableComponent;
import org.springframework.messaging.Message;
@@ -50,6 +51,7 @@ import org.springframework.util.Assert;
* @author Gary Russell
* @author Artem Bilan
*/
@IntegrationManagedResource
public abstract class MessagingGatewaySupport extends AbstractEndpoint
implements TrackableComponent, MessageSourceMetrics {
@@ -313,7 +315,7 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint
}
}
protected MessageChannel getRequestChannel() {
public MessageChannel getRequestChannel() {
if (this.requestChannelName != null) {
synchronized (this) {
if (this.requestChannelName != null) {