AMQP IO Platform Brussels Compatibility

https://build.spring.io/browse/INT-MJATS41-884/

The gateway must start the template.
This commit is contained in:
Gary Russell
2017-01-21 09:51:44 -05:00
parent 8a1aa98f72
commit d6f8120393
2 changed files with 15 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,6 +58,18 @@ public class AsyncAmqpOutboundGateway extends AbstractAmqpOutboundEndpoint {
return "amqp:outbound-async-gateway";
}
@Override
protected void doStart() {
super.doStart();
this.template.start();
}
@Override
protected void doStop() {
this.template.stop();
super.doStop();
}
@Override
protected Object handleRequestMessage(Message<?> requestMessage) {
org.springframework.amqp.core.Message amqpMessage = MappingUtils.mapMessage(requestMessage,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,6 +106,7 @@ public class OutboundEndpointTests {
gateway.setBeanFactory(mock(BeanFactory.class));
gateway.setOutputChannel(new NullChannel());
gateway.afterPropertiesSet();
gateway.start();
ArgumentCaptor<Message> captor = ArgumentCaptor.forClass(Message.class);
gateway.handleMessage(new GenericMessage<>("foo"));
verify(amqpTemplate).sendAndReceive(eq("foo"), eq("bar"), captor.capture());