INT-2404 Fix Auto-Created Channel; Event, TCP, UDP
The AbstractChannelAdapterParser creates an implicit DirectChannel if the adapter has no 'channel' attribute. The Event, TCP, and UDP channel adapter parsers did not bind this channel to the adapter and AC initialization failed with 'outputChannel is required'. Further, the event schema marked the channel as being 'required', precluding this feature. INT-2407 Remove Channel use="required" Parsers automatically generate the channel when none is provided. - JMX - JDBC - SFTP - Redis - Feed - XMPP - Mail - FTP - HTTP
This commit is contained in:
committed by
Mark Fisher
parent
e7b514a1e4
commit
292aa90599
@@ -50,4 +50,13 @@
|
||||
<header name="lname" expression="#pathVariables.l"/>
|
||||
</inbound-channel-adapter>
|
||||
|
||||
<inbound-channel-adapter id="autoChannel"
|
||||
path="/fname/{f}/lname/{l}"
|
||||
mapped-request-headers="foo,bar"
|
||||
payload-expression="#pathVariables.f">
|
||||
<header name="lname" expression="#pathVariables.l"/>
|
||||
</inbound-channel-adapter>
|
||||
|
||||
<si:bridge input-channel="autoChannel" output-channel="nullChannel" />
|
||||
|
||||
</beans:beans>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 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.
|
||||
@@ -19,6 +19,7 @@ package org.springframework.integration.http.config;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -40,6 +41,7 @@ import org.springframework.expression.spel.SpelEvaluationException;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.http.MockHttpServletRequest;
|
||||
@@ -56,6 +58,7 @@ import org.springframework.util.MultiValueMap;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gary Russell
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@@ -90,6 +93,11 @@ public class HttpInboundChannelAdapterParserTests {
|
||||
@Autowired
|
||||
private HttpRequestHandlingController inboundController;
|
||||
|
||||
@Autowired
|
||||
private MessageChannel autoChannel;
|
||||
|
||||
@Autowired @Qualifier("autoChannel.adapter")
|
||||
private HttpRequestHandlingMessagingGateway autoChannelAdapter;
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -259,6 +267,10 @@ public class HttpInboundChannelAdapterParserTests {
|
||||
assertEquals("oops", errorCode);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAutoChannel() {
|
||||
assertSame(autoChannel, TestUtils.getPropertyValue(autoChannelAdapter, "requestChannel"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class TestObject implements Serializable {
|
||||
|
||||
Reference in New Issue
Block a user