INT-1768 added support for propagating AcknowledgeMode to JmsTemplate when explicitly set on JMS inbound-channel-adapter
This commit is contained in:
@@ -31,6 +31,7 @@ import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
@@ -40,7 +41,7 @@ public class JmsInboundChannelAdapterParserTests {
|
||||
long timeoutOnReceive = 3000;
|
||||
|
||||
@Test
|
||||
public void adapterWithJmsTemplate() {
|
||||
public void adapterWithJmsTemplate() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"jmsInboundWithJmsTemplate.xml", this.getClass());
|
||||
PollableChannel output = (PollableChannel) context.getBean("output");
|
||||
@@ -53,6 +54,15 @@ public class JmsInboundChannelAdapterParserTests {
|
||||
assertNotNull("message should not be null", message);
|
||||
assertEquals("polling-test", message.getPayload());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adapterWithoutJmsTemplateAndAcknowlegeMode() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"jmsInboundWithJmsTemplate.xml", this.getClass());
|
||||
JmsTemplate jmsTemplate =
|
||||
TestUtils.getPropertyValue(context.getBean("inboundAdapterWithoutJmsTemplate"), "source.jmsTemplate", JmsTemplate.class);
|
||||
assertEquals(0, jmsTemplate.getSessionAcknowledgeMode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adapterWithConnectionFactoryAndDestination() {
|
||||
|
||||
@@ -13,7 +13,12 @@
|
||||
<integration:message-history/>
|
||||
|
||||
<jms:inbound-channel-adapter id="inboundAdapter" jms-template="jmsTemplate" channel="output"/>
|
||||
|
||||
<jms:inbound-channel-adapter id="inboundAdapterWithoutJmsTemplate" channel="outputA" acknowledge="transacted"
|
||||
destination-name="foo.bar"/>
|
||||
|
||||
<integration:channel id="outputA"/>
|
||||
|
||||
<integration:channel id="output">
|
||||
<integration:queue capacity="1"/>
|
||||
</integration:channel>
|
||||
|
||||
Reference in New Issue
Block a user