Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangyingyang
2024-11-17 11:06:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a6fd10b03556be20968f93a808ff9df620aa2e73
a6fd10b0
1 parent
db51e66c
add rgpc stub
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
src/main/java/com/infoloop/tianting/config/GrpcConfig.java
src/main/java/com/infoloop/tianting/constant/ConfigConstants.java
src/main/resources/application.properties
src/main/java/com/infoloop/tianting/config/GrpcConfig.java
View file @
a6fd10b
package
com
.
infoloop
.
tianting
.
config
;
import
com.infoloop.rpc.meizhongyiheservice.MeiZhongYiHeServiceRpcGrpc
;
import
com.infoloop.tianting.COperatorServiceProtoRpcGrpc
;
import
com.infoloop.tianting.CategoriesServiceProtoRpcGrpc
;
import
com.infoloop.tianting.SkuServiceProtoRpcGrpc
;
...
...
@@ -43,6 +44,9 @@ import static com.infoloop.tianting.constant.ConfigConstants.EXAMPLE_SERVICE_RPC
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MEAL_SERVICE_CHANNEL
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MEAL_SERVICE_RPC_PORT
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MEAL_SERVICE_RPC_URL
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MEIZHONGYIHE_SERVICE_CHANNEL
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MEIZHONGYIHE_SERVICE_RPC_PORT
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MEIZHONGYIHE_SERVICE_RPC_URL
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MENU_SERVICE_CHANNEL
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MENU_SERVICE_RPC_PORT
;
import
static
com
.
infoloop
.
tianting
.
constant
.
ConfigConstants
.
MENU_SERVICE_RPC_URL
;
...
...
@@ -230,4 +234,21 @@ public class GrpcConfig {
public
COperatorServiceProtoRpcGrpc
.
COperatorServiceProtoRpcBlockingStub
operatorServiceRpcBlockingStub
(
@Autowired
@Qualifier
(
OPERATOR_SERVICE_CHANNEL
)
final
ManagedChannel
channel
)
{
return
COperatorServiceProtoRpcGrpc
.
newBlockingStub
(
channel
);
}
@Bean
(
MEIZHONGYIHE_SERVICE_CHANNEL
)
public
ManagedChannel
meiZhongYiHeServiceChannel
(
@Value
(
MEIZHONGYIHE_SERVICE_RPC_URL
)
final
String
url
,
@Value
(
MEIZHONGYIHE_SERVICE_RPC_PORT
)
final
int
port
,
@Autowired
final
ClientInterceptor
clientInterceptor
)
{
return
NettyChannelBuilder
.
forAddress
(
url
,
port
)
.
idleTimeout
(
DEFAULT_TIMEOUT_DAYS
,
TimeUnit
.
DAYS
)
.
intercept
(
clientInterceptor
)
.
usePlaintext
()
.
maxInboundMessageSize
(
Integer
.
MAX_VALUE
)
.
build
();
}
@Bean
public
MeiZhongYiHeServiceRpcGrpc
.
MeiZhongYiHeServiceRpcBlockingStub
meiZhongYiHeServiceRpcBlockingStub
(
@Autowired
@Qualifier
(
MEIZHONGYIHE_SERVICE_CHANNEL
)
final
ManagedChannel
channel
)
{
return
MeiZhongYiHeServiceRpcGrpc
.
newBlockingStub
(
channel
);
}
}
...
...
src/main/java/com/infoloop/tianting/constant/ConfigConstants.java
View file @
a6fd10b
...
...
@@ -64,6 +64,10 @@ public interface ConfigConstants {
String
OPERATOR_SERVICE_RPC_PORT
=
"${grpc.operator-service.port}"
;
String
OPERATOR_SERVICE_CHANNEL
=
"operator-service-channel"
;
String
MEIZHONGYIHE_SERVICE_RPC_URL
=
"${grpc.meizhongyihe-service.url}"
;
String
MEIZHONGYIHE_SERVICE_RPC_PORT
=
"${grpc.meizhongyihe-service.port}"
;
String
MEIZHONGYIHE_SERVICE_CHANNEL
=
"meizhongyihe-service-channel"
;
String
ASYNC_EXECUTOR
=
"asyncExecutor"
;
String
SCHEDULED_TASK_EXECUTOR
=
"scheduledTaskExecutor"
;
...
...
src/main/resources/application.properties
View file @
a6fd10b
...
...
@@ -64,6 +64,9 @@ grpc.delivery-service.port=3017
grpc.operator-
service.url
=
47.101.193.136
grpc.operator-
service.port
=
3031
grpc.meizhongyihe-
service.url
=
47.101.193.136
grpc.meizhongyihe-
service.port
=
3031
miniprogram.appId
=
wx40ec496d73b58ec6
miniprogram.appSecret
=
5b309517bf918abf760b2195e91b99f3
...
...
Please
register
or
login
to post a comment