Skip to content

Commit cec1779

Browse files
committed
feat(int-aws): SnsInboundChannelAdapterParser, SnsOutboundChannelAdapterParser
1 parent 7c7b6b8 commit cec1779

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

int-aws-support/src/main/resources/org/springframework/integration/aws/support/config/xml/element-parser.mapping

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ s3-outbound-channel-adapter: org.springframework.integration.aws.support.config.
44
s3-outbound-gateway: org.springframework.integration.aws.support.config.xml.parsers.S3OutboundGatewayParser
55
sqs-outbound-channel-adapter: org.springframework.integration.aws.support.config.xml.parsers.SqsOutboundChannelAdapterParser
66
sqs-message-driven-channel-adapter: org.springframework.integration.aws.support.config.xml.parsers.SqsMessageDrivenChannelAdapterParser
7-
sns-inbound-channel-adapter: org.springframework.integration.aws.support.config.xml.parsers.SnsInboundChannelAdapterParser
7+
sns-inbound-channel-adapter: org.springframework.integration.aws.config.xml.parsers.SnsInboundChannelAdapterParser
88
sns-outbound-channel-adapter: org.springframework.integration.aws.support.config.xml.parsers.SnsOutboundChannelAdapterParser

int-aws-support/src/test/java/org/springframework/integration/aws/support/config/xml/SpringIntegrationAwsNamespaceHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import org.springframework.integration.aws.config.xml.SpringIntegrationAwsNamespaceHandler;
77
import org.springframework.integration.aws.config.xml.parsers.S3InboundChannelAdapterParser;
88
import org.springframework.integration.aws.config.xml.parsers.S3InboundStreamingChannelAdapterParser;
9+
import org.springframework.integration.aws.config.xml.parsers.SnsInboundChannelAdapterParser;
910
import org.springframework.integration.aws.support.config.xml.parsers.S3OutboundChannelAdapterParser;
1011
import org.springframework.integration.aws.support.config.xml.parsers.S3OutboundGatewayParser;
11-
import org.springframework.integration.aws.support.config.xml.parsers.SnsInboundChannelAdapterParser;
1212
import org.springframework.integration.aws.support.config.xml.parsers.SnsOutboundChannelAdapterParser;
1313
import org.springframework.integration.aws.support.config.xml.parsers.SqsMessageDrivenChannelAdapterParser;
1414
import org.springframework.integration.aws.support.config.xml.parsers.SqsOutboundChannelAdapterParser;

int-aws/build.gradle

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@ plugins {
22
id "java-conventions"
33
}
44

5-
sourceSets {
6-
main {
7-
java {
8-
source objects.sourceDirectorySet("aws-support", "aws support classes").tap {
9-
srcDir "$rootDir/int-aws-support/src/main/java"
10-
setIncludes([
11-
"**/SnsInboundChannelAdapterParser.java",
12-
"**/SnsOutboundChannelAdapterParser.java"
13-
])
14-
}
15-
}
16-
}
17-
}
18-
195
dependencies {
206
api "org.springframework.integration:spring-integration-aws"
217

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.springframework.integration.aws.support.config.xml.parsers;
1+
package org.springframework.integration.aws.config.xml.parsers;
22

33
import org.springframework.beans.factory.support.AbstractBeanDefinition;
44
import org.springframework.beans.factory.xml.ParserContext;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.springframework.integration.aws.config.xml.parsers;
2+
3+
import org.springframework.beans.factory.support.AbstractBeanDefinition;
4+
import org.springframework.beans.factory.xml.ParserContext;
5+
import org.springframework.integration.aws.config.xml.XmlBeanDefinitionBuilder;
6+
import org.springframework.integration.aws.outbound.SnsMessageHandler;
7+
import org.springframework.integration.config.xml.AbstractOutboundChannelAdapterParser;
8+
import org.w3c.dom.Element;
9+
10+
public class SnsOutboundChannelAdapterParser extends AbstractOutboundChannelAdapterParser {
11+
12+
@Override
13+
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {
14+
return XmlBeanDefinitionBuilder.newInstance(element, parserContext, SnsMessageHandler.class)
15+
.addConstructorArgReference("sns")
16+
.setPropertyIfAttributeDefined("async")
17+
.setPropertyIfAttributeDefined("output-channel", "outputChannelName")
18+
.setPropertyOrExpressionIfAttributeDefined("topic-arn")
19+
.setPropertyOrExpressionIfAttributeDefined("subject")
20+
.setPropertyOrExpressionIfAttributeDefined("message-group-id")
21+
.setPropertyOrExpressionIfAttributeDefined("message-deduplication-id")
22+
.setPropertyOrExpressionIfAttributeDefined("body")
23+
.setPropertyOrExpressionIfAttributeDefined("send-timeout")
24+
.build();
25+
}
26+
}

int-aws/src/main/resources/org/springframework/integration/aws/config/xml/element-parser.mapping

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ kinesis-outbound-channel-adapter: org.springframework.integration.aws.config.xml
88
kpl-outbound-channel-adapter: org.springframework.integration.aws.config.xml.parsers.KplOutboundChannelAdapterParser
99
sqs-outbound-channel-adapter: org.springframework.integration.aws.config.xml.parsers.SqsOutboundChannelAdapterParser
1010
sqs-message-driven-channel-adapter: org.springframework.integration.aws.config.xml.parsers.SqsMessageDrivenChannelAdapterParser
11-
sns-inbound-channel-adapter: org.springframework.integration.aws.support.config.xml.parsers.SnsInboundChannelAdapterParser
12-
sns-outbound-channel-adapter: org.springframework.integration.aws.support.config.xml.parsers.SnsOutboundChannelAdapterParser
11+
sns-inbound-channel-adapter: org.springframework.integration.aws.config.xml.parsers.SnsInboundChannelAdapterParser
12+
sns-outbound-channel-adapter: org.springframework.integration.aws.config.xml.parsers.SnsOutboundChannelAdapterParser

int-aws/src/test/java/org/springframework/integration/aws/config/xml/SpringIntegrationAwsNamespaceHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import org.springframework.integration.aws.config.xml.parsers.S3InboundStreamingChannelAdapterParser;
1212
import org.springframework.integration.aws.config.xml.parsers.S3OutboundChannelAdapterParser;
1313
import org.springframework.integration.aws.config.xml.parsers.S3OutboundGatewayParser;
14+
import org.springframework.integration.aws.config.xml.parsers.SnsInboundChannelAdapterParser;
15+
import org.springframework.integration.aws.config.xml.parsers.SnsOutboundChannelAdapterParser;
1416
import org.springframework.integration.aws.config.xml.parsers.SqsMessageDrivenChannelAdapterParser;
1517
import org.springframework.integration.aws.config.xml.parsers.SqsOutboundChannelAdapterParser;
16-
import org.springframework.integration.aws.support.config.xml.parsers.SnsInboundChannelAdapterParser;
17-
import org.springframework.integration.aws.support.config.xml.parsers.SnsOutboundChannelAdapterParser;
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
2020

0 commit comments

Comments
 (0)