File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed
java/com/ericsson/ei/notifications Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 6
6
<modelVersion >4.0.0</modelVersion >
7
7
<groupId >com.github.ericsson</groupId >
8
8
<artifactId >eiffel-intelligence</artifactId >
9
- <version >3.2.3 </version >
9
+ <version >3.2.4 </version >
10
10
<packaging >war</packaging >
11
11
12
12
<parent >
Original file line number Diff line number Diff line change 19
19
import com .ericsson .ei .exception .AuthenticationException ;
20
20
import com .fasterxml .jackson .databind .JsonNode ;
21
21
22
+ import java .time .Duration ;
23
+
22
24
import org .slf4j .Logger ;
23
25
import org .slf4j .LoggerFactory ;
26
+ import org .springframework .beans .factory .annotation .Autowired ;
27
+ import org .springframework .beans .factory .annotation .Value ;
24
28
import org .springframework .boot .web .client .RestTemplateBuilder ;
25
29
import org .springframework .http .*;
26
30
import org .springframework .stereotype .Component ;
@@ -38,8 +42,10 @@ public class HttpRequestSender {
38
42
39
43
private RestOperations rest ;
40
44
41
- public HttpRequestSender (RestTemplateBuilder builder ) {
42
- rest = builder .build ();
45
+ @ Autowired
46
+ public HttpRequestSender (RestTemplateBuilder builder , @ Value ("${notification.httpRequest.timeout:5000}" ) Duration timeOut ) {
47
+ timeOut = timeOut == null ? Duration .ofMillis (5000 ) : timeOut ;
48
+ rest = builder .setReadTimeout (timeOut ).setConnectTimeout (timeOut ).build ();
43
49
}
44
50
45
51
/**
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ waitlist.resend.fixed.rate: 15000
46
46
failed.notifications.collection.name : failed_notifications
47
47
failed.notifications.collection.ttl : 600
48
48
notification.retry : 3
49
+ notification.httpRequest.timeout : 5000
49
50
50
51
email.sender : noreply@domain.com
51
52
email.subject : Email Subscription Notification
Original file line number Diff line number Diff line change @@ -156,10 +156,13 @@ Eiffel Intelligence how long a failed notification will be stored in the
156
156
database before deletion. With ** notification.retry** property, it
157
157
is possible to configure the number of attempts Eiffel Intelligence will
158
158
retry to make a REST POST notification when a subscription is triggered.
159
+ The ** notification.httpRequest.timeout** property value will be used to set the
160
+ response timeout for the Rest Post notifications when a subscription is triggered.
159
161
160
162
* failed.notifications.collection.name
161
163
* failed.notifications.collection.ttl
162
164
* notification.retry
165
+ * notification.httpRequest.timeout
163
166
164
167
### Configure Search in Event Repository
165
168
You can’t perform that action at this time.
0 commit comments