-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathechoservice.thrift
73 lines (64 loc) · 1.7 KB
/
echoservice.thrift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
namespace java com.motus.echoservice.thrift
/**
* The EchoService Error Code. <br/>
*/
enum EchoServiceErrorCode {
ERROR_CODE_0,
ERROR_CODE_1,
// TODO Add your desired error codes here
OTHER_ERROR_REASON,
/**
* Unknown error (unexpected ones)
*/
UNKNOWN_ERROR;
}
/**
* The EchoService Business Exception. <br/>
* We send this back in case there is an error in actual business logic. <br/>
* This is supposed to be non-retry-able from client side.
*/
exception TEchoServiceBusinessException
{
1: optional map<EchoServiceErrorCode, string> errors, // would be nice to say something about what happened
2: optional string serviceMessage,
3: optional string serviceStackTrace;
}
/**
* The EchoService Failure Exception. <br/>
* We send this back in case there is an error in communication with other services and so on. <br/>
* This is supposed to be retry-able from client side.
*/
exception TEchoServiceFailureException
{
1: optional map<EchoServiceErrorCode, string> errors, // would be nice to say something about what happened
2: optional string serviceMessage,
3: optional string serviceStackTrace;
}
/**
* Echo service input DTO. <br/>
*/
struct TEchoServiceInputDTO
{
1: string message;
}
/**
* Echo service output DTO.<br/>
*/
struct TEchoServiceOutputDTO
{
1: string echoMessage;
}
struct EchoEvent
{
1: string echoMessage
}
/**
* Thrift service interface for the EchoService.
*/
service EchoService {
/**
* Sample sayMyName method.<br/>
* It shows how to handle input and output as DTOs.
*/
TEchoServiceOutputDTO echo(1: TEchoServiceInputDTO inputDTO) throws (1: TEchoServiceBusinessException businessException, 2: TEchoServiceFailureException failureException);
}