Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
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
黄营
datax-cloud
Commits
5054ced3
Commit
5054ced3
authored
Sep 18, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
a8a472c7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
1 deletions
+57
-1
FlowInstanceServiceFeign.java
.../service/workflow/api/feign/FlowInstanceServiceFeign.java
+15
-0
FlowInstanceServiceFeignFallbackFactory.java
...eign/factory/FlowInstanceServiceFeignFallbackFactory.java
+17
-0
FlowInstanceServiceFeignFallbackImpl.java
.../feign/fallback/FlowInstanceServiceFeignFallbackImpl.java
+22
-0
spring.factories
...-service-api/src/main/resources/META-INF/spring.factories
+3
-1
No files found.
datax-modules/workflow-service-parent/workflow-service-api/src/main/java/cn/datax/service/workflow/api/feign/FlowInstanceServiceFeign.java
0 → 100644
View file @
5054ced3
package
cn
.
datax
.
service
.
workflow
.
api
.
feign
;
import
cn.datax.service.workflow.api.dto.ProcessInstanceCreateRequest
;
import
cn.datax.service.workflow.api.feign.factory.FlowInstanceServiceFeignFallbackFactory
;
import
cn.datax.service.workflow.api.vo.FlowInstanceVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
@FeignClient
(
contextId
=
"flowInstanceServiceFeign"
,
value
=
"datax-service-workflow"
,
fallbackFactory
=
FlowInstanceServiceFeignFallbackFactory
.
class
)
public
interface
FlowInstanceServiceFeign
{
@PostMapping
(
"/instances/startById"
)
FlowInstanceVo
startById
(
@RequestBody
ProcessInstanceCreateRequest
request
);
}
datax-modules/workflow-service-parent/workflow-service-api/src/main/java/cn/datax/service/workflow/api/feign/factory/FlowInstanceServiceFeignFallbackFactory.java
0 → 100644
View file @
5054ced3
package
cn
.
datax
.
service
.
workflow
.
api
.
feign
.
factory
;
import
cn.datax.service.workflow.api.feign.FlowInstanceServiceFeign
;
import
cn.datax.service.workflow.api.feign.fallback.FlowInstanceServiceFeignFallbackImpl
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.stereotype.Component
;
@Component
public
class
FlowInstanceServiceFeignFallbackFactory
implements
FallbackFactory
<
FlowInstanceServiceFeign
>
{
@Override
public
FlowInstanceServiceFeign
create
(
Throwable
throwable
)
{
FlowInstanceServiceFeignFallbackImpl
flowInstanceServiceFeignFallback
=
new
FlowInstanceServiceFeignFallbackImpl
();
flowInstanceServiceFeignFallback
.
setCause
(
throwable
);
return
flowInstanceServiceFeignFallback
;
}
}
datax-modules/workflow-service-parent/workflow-service-api/src/main/java/cn/datax/service/workflow/api/feign/fallback/FlowInstanceServiceFeignFallbackImpl.java
0 → 100644
View file @
5054ced3
package
cn
.
datax
.
service
.
workflow
.
api
.
feign
.
fallback
;
import
cn.datax.service.workflow.api.dto.ProcessInstanceCreateRequest
;
import
cn.datax.service.workflow.api.feign.FlowInstanceServiceFeign
;
import
cn.datax.service.workflow.api.vo.FlowInstanceVo
;
import
lombok.Setter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
@Slf4j
@Component
public
class
FlowInstanceServiceFeignFallbackImpl
implements
FlowInstanceServiceFeign
{
@Setter
private
Throwable
cause
;
@Override
public
FlowInstanceVo
startById
(
ProcessInstanceCreateRequest
request
)
{
log
.
error
(
"feign 调用{}出错"
,
request
,
cause
);
return
null
;
}
}
datax-modules/workflow-service-parent/workflow-service-api/src/main/resources/META-INF/spring.factories
View file @
5054ced3
org.springframework.boot.autoconfigure.EnableAutoConfiguration=
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.datax.service.workflow.api.feign.factory.FlowInstanceServiceFeignFallbackFactory,\
cn.datax.service.workflow.api.feign.fallback.FlowInstanceServiceFeignFallbackImpl
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