Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OTSWithFeign
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siva Naga Someswara Jatla
OTSWithFeign
Commits
75bcbd2c
Commit
75bcbd2c
authored
May 05, 2020
by
sgandhi@nisum.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EPE-006 : added feign client for end of transaction call.
parent
7140b2c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
StoreProducerFeignClient.java
...ertransactionservice/client/StoreProducerFeignClient.java
+14
-0
EndOfTransactionService.java
...ertransactionservice/service/EndOfTransactionService.java
+5
-3
application.properties
src/main/resources/application.properties
+1
-0
No files found.
src/main/java/com/nisum/offertransactionservice/client/StoreProducerFeignClient.java
0 → 100644
View file @
75bcbd2c
package
com
.
nisum
.
offertransactionservice
.
client
;
import
com.nisum.offertransactionservice.dto.PERequest
;
import
com.nisum.offertransactionservice.dto.PEResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
@FeignClient
(
name
=
"${storeproducer.application.name}"
)
public
interface
StoreProducerFeignClient
{
@PostMapping
(
value
=
"${endpoint.url.storeProducerUrl}"
)
ResponseEntity
<
String
>
callStoreProducer
(
String
transactionId
);
}
src/main/java/com/nisum/offertransactionservice/service/EndOfTransactionService.java
View file @
75bcbd2c
package
com
.
nisum
.
offertransactionservice
.
service
;
import
com.nisum.offertransactionservice.client.ClientService
;
import
com.nisum.offertransactionservice.client.StoreProducerFeignClient
;
import
com.nisum.offertransactionservice.genericexception.GlobalApiGenericException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
reactor.core.publisher.Mono
;
...
...
@@ -19,7 +21,7 @@ import java.util.Objects;
public
class
EndOfTransactionService
{
@Autowired
ClientService
clientService
;
private
StoreProducerFeignClient
storeProducerFeignClient
;
public
String
endOfTransaction
(
String
uuid
)
{
if
(
Objects
.
isNull
(
uuid
)
||
uuid
.
isEmpty
())
{
...
...
@@ -27,9 +29,9 @@ public class EndOfTransactionService {
throw
new
GlobalApiGenericException
(
"Unable to get the Offer transaction uuid "
,
new
Exception
(
"exception e"
),
"400"
,
false
);
}
log
.
info
(
"Store Consumer WebClient call Start"
);
Mono
<
String
>
endOfTransactionRes
=
clientService
.
getStringMono
(
uuid
);
ResponseEntity
<
String
>
endOfTransactionRes
=
storeProducerFeignClient
.
callStoreProducer
(
uuid
);
log
.
debug
(
"Store consumer WebClient call End"
);
return
endOfTransactionRes
.
toString
();
return
endOfTransactionRes
.
getBody
();
}
...
...
src/main/resources/application.properties
View file @
75bcbd2c
...
...
@@ -3,6 +3,7 @@ spring.datasource.username=postgres
spring.datasource.password
=
dbpwd
endpoint.url.promotionEngineUrl
=
/promotionEngine/calculateDiscount
pe.application.name
=
pe
storeproducer.application.name
=
storeproducer
endpoint.url.storeProducerUrl
=
/store/producer
endpoint.url.spBaseUrl
=
http://localhost:7070
server.port
=
7072
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment