File tree 2 files changed +21
-7
lines changed
create-openapi-client/banking-service/src/main/java/com/backbase/banking/config
service-to-service-communication/example-service-to-service/src/main/java/com/backbase/example/service
2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 11
11
12
12
// tag::MessagingServiceRestClientConfiguration[]
13
13
@ Configuration
14
- @ ConfigurationProperties ("backbase.communication.services.name " )
14
+ @ ConfigurationProperties ("backbase.communication.services.messaging-service " )
15
15
@ Validated
16
16
public class MessagingServiceRestClientConfiguration extends ApiClientConfig {
17
17
18
- public static final String MESSAGING_SERVICE_ID = "messaging-service" ;
18
+ public static final String SERVICE_ID = "messaging-service" ;
19
19
20
20
public MessagingServiceRestClientConfiguration () {
21
- super (MESSAGING_SERVICE_ID );
21
+ super (SERVICE_ID );
22
22
}
23
23
24
24
/**
@@ -27,7 +27,7 @@ public MessagingServiceRestClientConfiguration() {
27
27
* @return the client.
28
28
*/
29
29
@ Bean
30
- public MessageApi createGeneratedClassApiClient () {
30
+ public MessageApi messageApiClient () {
31
31
return new MessageApi (createApiClient ());
32
32
}
33
33
Original file line number Diff line number Diff line change 1
1
package com .backbase .example .service ;
2
2
3
3
import com .backbase .buildingblocks .communication .client .ApiClientConfig ;
4
+ import com .backbase .buildingblocks .communication .http .HttpCommunicationConfiguration ;
4
5
import com .backbase .integration .example .client .ApiClient ;
5
6
import com .backbase .integration .example .client .v1 .MessageApi ;
7
+ import org .springframework .boot .context .properties .ConfigurationProperties ;
6
8
import org .springframework .context .annotation .Bean ;
7
9
import org .springframework .context .annotation .Configuration ;
10
+ import org .springframework .validation .annotation .Validated ;
8
11
9
12
@ Configuration
13
+ @ ConfigurationProperties ("backbase.communication.services.messaging-integration-service" )
14
+ @ Validated
10
15
public class IntegrationApiClientConfig extends ApiClientConfig {
11
16
17
+ public static final String SERVICE_ID = "messaging-integration-service" ;
18
+
12
19
public IntegrationApiClientConfig () {
13
- super ("example-integration-service" );
20
+ super (SERVICE_ID );
14
21
}
15
22
23
+ /**
24
+ * Creates a REST client.
25
+ *
26
+ * @return the client.
27
+ */
28
+
16
29
@ Bean
17
- public MessageApi exampleIntegrationApiClient () {
30
+ public MessageApi messageIntegrationApiClient () {
18
31
return new MessageApi (createaApiClient ());
19
32
}
20
33
21
34
private ApiClient createaApiClient () {
22
35
return new ApiClient (getRestTemplate ())
23
- .setBasePath (createBasePath ());
36
+ .setBasePath (createBasePath ())
37
+ .addDefaultHeader (HttpCommunicationConfiguration .INTERCEPTORS_ENABLED_HEADER , Boolean .TRUE .toString ());
24
38
}
25
39
}
You can’t perform that action at this time.
0 commit comments