Skip to content

Commit 8ed4e5f

Browse files
authored
Doc for @Gateway in the @MessagingGateway (#8578)
It is not obvious from the `@MessagingGateway` Javadocs how to configure an individual service method * Add links and explanation about per-method `@Gateway` annotation into the `@MessagingGateway`
1 parent 05f1fd8 commit 8ed4e5f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: spring-integration-core/src/main/java/org/springframework/integration/annotation/MessagingGateway.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,6 +34,8 @@
3434
* to scan interfaces annotated with {@link MessagingGateway}, because the
3535
* standard {@link org.springframework.context.annotation.ComponentScan}
3636
* ignores interfaces.
37+
* <p>
38+
* The {@link Gateway} annotation can be used for the per interface method configuration.
3739
*
3840
* @author Artem Bilan
3941
* @author Gary Russell
@@ -42,6 +44,7 @@
4244
*
4345
* @see IntegrationComponentScan
4446
* @see MessageEndpoint
47+
* @see Gateway
4548
*/
4649
@Target(ElementType.TYPE)
4750
@Retention(RetentionPolicy.RUNTIME)
@@ -68,6 +71,7 @@
6871
/**
6972
* Identifies the default channel to which messages will be sent upon invocation
7073
* of methods of the gateway proxy.
74+
* See {@link Gateway#requestChannel()} for per-method configuration.
7175
* @return the suggested channel name, if any
7276
*/
7377
String defaultRequestChannel() default "";
@@ -76,6 +80,7 @@
7680
* Identifies the default channel the gateway proxy will subscribe to, to receive reply
7781
* {@code Message}s, the payloads of
7882
* which will be converted to the return type of the method signature.
83+
* See {@link Gateway#replyChannel()} for per-method configuration.
7984
* @return the suggested channel name, if any
8085
*/
8186
String defaultReplyChannel() default "";
@@ -95,6 +100,7 @@
95100
* example if this gateway is hooked up to a {@code QueueChannel}. Value is specified
96101
* in milliseconds; it can be a simple long value or a SpEL expression; array variable
97102
* #args is available.
103+
* See {@link Gateway#requestTimeout()} for per-method configuration.
98104
* @return the suggested timeout in milliseconds, if any
99105
*/
100106
String defaultRequestTimeout() default "-9223372036854775808";
@@ -104,6 +110,7 @@
104110
* before returning. By default, it will wait indefinitely. {@code null} is returned if
105111
* the gateway times out. Value is specified in milliseconds; it can be a simple long
106112
* value or a SpEL expression; array variable #args is available.
113+
* See {@link Gateway#replyTimeout()} for per-method configuration.
107114
* @return the suggested timeout in milliseconds, if any
108115
*/
109116
String defaultReplyTimeout() default "-9223372036854775808";
@@ -124,13 +131,15 @@
124131
* unless explicitly overridden by a method declaration. Variables include {@code #args}, {@code #methodName},
125132
* {@code #methodString} and {@code #methodObject};
126133
* a bean resolver is also available, enabling expressions like {@code @someBean(#args)}.
134+
* See {@link Gateway#payloadExpression()} for per-method configuration.
127135
* @return the suggested payload expression, if any
128136
*/
129137
String defaultPayloadExpression() default "";
130138

131139
/**
132140
* Provides custom message headers. These default headers are created for
133141
* all methods on the service-interface (unless overridden by a specific method).
142+
* See {@link Gateway#headers()} for per-method configuration.
134143
* @return the suggested payload expression, if any
135144
*/
136145
GatewayHeader[] defaultHeaders() default {};

0 commit comments

Comments
 (0)