File tree 2 files changed +27
-0
lines changed
dynamic-tcp/src/main/java/org/spring/integration/dynamic/tcp/spec
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ This is just a simple implementation of single request/reply using dynamic regis
22
22
.deserializer(deserializer)
23
23
.serializer(serializer)
24
24
.cacheable("!headers['host'].equals(\"127.0.0.1\")")
25
+ .connectTimeout(30)
26
+ .remoteTimeout(20_000L)
25
27
.responseChannelName("serverResponseChannel"))
26
28
.get();
27
29
}
Original file line number Diff line number Diff line change 6
6
import org .springframework .integration .dsl .MessageProcessorSpec ;
7
7
import org .springframework .integration .dsl .context .IntegrationFlowContext ;
8
8
import org .springframework .integration .expression .FunctionExpression ;
9
+ import org .springframework .integration .expression .ValueExpression ;
9
10
import org .springframework .integration .ip .tcp .serializer .AbstractByteArraySerializer ;
10
11
import org .springframework .messaging .Message ;
11
12
@@ -142,6 +143,30 @@ public DynamicTcpOutboundGatewaySpec remoteTimeout(String expression) {
142
143
return _this ();
143
144
}
144
145
146
+ /**
147
+ * Setting a connectTimeout value retrieving expression from message
148
+ *
149
+ * @param timeout connect timeout value
150
+ * @return DynamicTcpOutboundGatewaySpec
151
+ */
152
+ public DynamicTcpOutboundGatewaySpec connectTimeout (int timeout ) {
153
+ getRequestFlow ().setConnectTimeout (new ValueExpression <>(timeout ));
154
+ return _this ();
155
+ }
156
+
157
+ /**
158
+ * Setting a remoteTimeout value retrieving expression from message
159
+ *
160
+ * @param timeout remote timeout value
161
+ * @return DynamicTcpOutboundGatewaySpec
162
+ */
163
+ public DynamicTcpOutboundGatewaySpec remoteTimeout (long timeout ) {
164
+ getRequestFlow ().setRemoteTimeout (new ValueExpression <>(timeout ));
165
+ return _this ();
166
+ }
167
+
168
+
169
+
145
170
private DynamicTcpOutboundGateway getRequestFlow () {
146
171
return (DynamicTcpOutboundGateway ) this .target ;
147
172
}
You can’t perform that action at this time.
0 commit comments