0
点赞
收藏
分享

微信扫一扫

Biz-SIP业务中台案例实战(0)——实战环境的搭建

一、安装

1 项目源码下载

  1. 从“https://gitee.com/szhengye/biz-sip”中Clone下载项目源码(master分支)。
  2. 在Eclipse或IDEA中作为Maven项目导入。

2 MySQL安装

  1. 安装MySQL镜像
docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=bizsip123456 -d mysql
# 登录密码默认root/bizsip123456
  1. 建库

执行项目中sql/sample.sql脚本,以建立sip演示库。

3 Redis安装

docker run -p 6379:6379 -d redis:latest redis-server

4 RabbitMQ安装

docker pull rabbitmq
docker run -d --name rabbitmq -e RABBITMQ_DEFAULT_USER=springcloud -e RABBITMQ_DEFAULT_PASS=springcloud -p 15672:15672 -p 5672:5672 rabbitmq:management
# 下载延迟队列插件,并拷贝到容器中相关目录
docker cp rabbitmq_delayed_message_exchange-3.8.0.ez rabbitmq:/plugins
# 进入容器交互终端模式,用"docker ps"命令查询RabbitMQ的容器ID
docker exec -it <容器ID> bash
# 执行命令启用延迟队列插件
rabbitmq-plugins enable rabbitmq_delayed_message_exchange

访问RabbitMQ,默认账号/密码:admin/admin,访问地址:http://localhost:15672

5 Nacos安装

  1. 下载Nacos镜像
docker pull nacos/nacos-server
  1. 启动Nacos镜像
docker run --env MODE=standalone --name nacos -d -p 8848:8848 nacos/nacos-server
# 登录密码默认nacos/nacos
# standalone 代表单机模式运行,非集群模式
  1. 访问Nacos,默认账号/密码:nacos/nacos,访问地址:http://localhost:8848/nacos/index.html

二、配置

1 sample/sample-app模块相关配置文件

application.yml文件:

spring:
  profiles:
    active: local

application-local.yml文件:

server:
  port: 8888

spring:
  application:
    name: bizsip-integrator

  cloud:
    nacos:
      discovery:
        server-addr: bizsip-nacos:8848
        
  datasource:
    url: jdbc:mysql://bizsip-mysql/sip
    username: root
    password: bizsip123456
    driver-class-name: com.mysql.jdbc.Driver

  redis:
    redisson:
      enable: true
    host: bizsip-redis
    port: 6379
    timeout: 6000
    database: 0
    lettuce:
      pool:
        max-active: 10 # 连接池最大连接数(使用负值表示没有限制),如果赋值为-1,则表示不限制;如果pool已经分配了maxActive个jedis实例,则此时pool的状态为exhausted(耗尽)
        max-idle: 8   # 连接池中的最大空闲连接 ,默认值也是8
        max-wait: 100 # # 等待可用连接的最大时间,单位毫秒,默认值为-1,表示永不超时。如果超过等待时间,则直接抛出JedisConnectionException
        min-idle: 2    # 连接池中的最小空闲连接 ,默认值也是0
      shutdown-timeout: 100ms

  rabbitmq:
    virtual-host: /
    host: bizsip-rabbitmq
    port: 5672
    username: springcloud
    password: springcloud
    listener:
      simple:
        concurrency: 5
        max-concurrency: 15
        prefetch: 10

bizsip:
  config-path: /var/bizsip/config
  rabbitmq-log: fail

logging:
  level:
    com.bizmda.bizsip: info

其中:

  • server.port:App服务整合器的微服务端口,建议用8888端口,避免和其它端口相冲突。
  • spring.application.name:设置为“bizsip-integrator”
  • spring.datasource.*:为数据库相关配置,应连接对应的数据库。
  • spring.redis.*:为Redis相关配置,连接对应的Redis。
  • spring.rabbitmq.*:为RabbitMQ相关配置,连接RabbitMQ中间件。
  • bizsip.config-path:配置成项目下sample/config的实际安装目录。
  • bizsip.rabbitmq-log:交易日志开关,可设置为success、suspend、fail,不设置则为不发送交易日志。
  • logging.level.com.bizmda.bizsip:日志级别,一般设置为info。

2 sample/sample-sink模块相关配置文件

application.yml文件:

spring:
  profiles:
    active: local

application-local.yml文件:

server:
  port: 8001
spring:
  application:
    name: bizsip-sample-sink

  cloud:
    nacos:
      discovery:
        server-addr: bizsip-nacos:8848
  #  以下配置在Istio部署中打开,以不采用NACOS注册中心,而采用etcd注册机制
  #  cloud:
  #    service-registry:
  #      auto-registration:
  #        enabled: false  #禁用注册中心服务

  rabbitmq:
    virtual-host: /
    host: bizsip-rabbitmq
    port: 5672
    username: springcloud
    password: springcloud
    listener:
      simple:
        concurrency: 5
        max-concurrency: 15
        prefetch: 10

bizsip:
  config-path: /var/bizsip/config
  sink-id: long-tcp-netty-sink,hello-sink,hello-bean-sink,echo-sink,simple-xml-sink,velocity-json-sink,velocity-xml-sink,fixed-length-sink,velocity-split-sink,iso-8583-sink,netty-sink,sample16-sink,sample17-sink,rabbitmq-sink,rabbitmq-connector-sink
  rabbitmq-log: success

long-tcp-netty:
  sink-netty-server-port: 10001
  sink-netty-client-host: localhost
  sink-netty-client-port: 10002


logging:
  level:
    com.bizmda.bizsip: info

其中:

  • server.port:为sample服务接入模块的RESTful服务端口,建议用8080。
  • spring.application.name:设置为“bizsip-sample-sink”
  • spring.rabbitmq.*:为RabbitMQ相关配置,连接RabbitMQ中间件。
  • bizsip.config-path:配置成项目下sample/config的实际安装目录。
  • sink-id:如果在当前模块启动时,需要关联启动的Sink,就需要配置这个参数sink-id参数,可以配置多个,以逗号分隔。
  • long-tcp-netty:配置异步长连接测试用例涉及的,Sink作为Netty服务端时的端口,以及作为Netty客户端时的对方服务端IP地址和端口。
  • logging.level.com.bizmda.bizsip:日志级别,一般设置为info。

3 sample/sample-source模块相关配置文件

application.yml文件:

spring:
  profiles:
    active: local

application-local.yml文件:

server:
  port: 8080

spring:
  application:
    name: bizsip-sample-source

  cloud:
    nacos:
      discovery:
        server-addr: bizsip-nacos:8848
  
bizsip:
  config-path: /var/bizsip/config
  integrator-url: http://bizsip-integrator/api

long-tcp-netty:
  source-netty-client-host: localhost
  source-netty-client-port: 10001
  source-netty-server-port: 10002
  
logging:
  level:
    com.bizmda.bizsip: info

其中:

  • server.port:为sample服务调用模块的微服务端口,建议用8001,不要其它端口相冲突。
  • spring.application.name:设置为“sample-sample-source”
  • bizsip.integrator-url:为app服务整合器的服务接口url,原则上不需要修改。
  • bizsip.config-path:配置成项目下sample/config的实际安装目录。
  • long-tcp-netty:配置异步长连接测试用例涉及的,Source作为Netty服务端时的端口,以及作为Netty客户端时的对方服务端IP地址和端口。
  • logging.level.com.bizmda.bizsip:日志级别,一般设置为info。

4 source/netty-source模块相关配置文件

application.yml文件:

spring:
  profiles:
    active: local

application-local.yml文件:

server:
  port: 8090

spring:
  application:
    name: bizsip-netty-source

  cloud:
    nacos:
      discovery:
        server-addr: bizsip-nacos:8848

bizsip:
  config-path: /var/bizsip/config
  integrator-url: http://bizsip-integrator/api
  source-id: source1

netty:
  port: 10020

logging:
  level:
    com.bizmda.bizsip: debug

其中:

  • server.port:为sample服务调用模块的微服务端口,建议用8090,不要其它端口相冲突。
  • spring.application.name:设置为“bizsip-netty-source”
  • bizsip.integrator-url:为App服务整合器的服务接口url,原则上不需要修改。
  • bizsip.config-path:配置成项目下sample/config的实际安装目录。
  • bizsip.source-id:为当前source模块的Source ID。
  • netty.port:Source作为Netty服务端时的端口。
  • logging.level.com.bizmda.bizsip:日志级别,一般设置为info。

5 sample/sample-app-log模块相关配置文件

application.yml文件:

spring:
  profiles:
    active: local

application-local.yml文件:

server:
  port: 8100

spring:
  application:
    name: sample-app-log

  datasource:
    url: jdbc:mysql://bizsip-mysql/sip
    username: root
    password: bizsip123456
    driver-class-name: com.mysql.jdbc.Driver

  rabbitmq:
    virtual-host: /
    host: bizsip-rabbitmq
    port: 5672
    username: springcloud
    password: springcloud
    listener:
      simple:
        concurrency: 5
        max-concurrency: 15
        prefetch: 10

logging:
  level:
    com.bizmda.bizsip: info

其中:

  • server.port:为sample服务调用模块的微服务端口,建议用8100,不要其它端口相冲突。
  • spring.application.name:设置为“sample-app-log”
  • spring.datasource.*:为数据库相关配置,应连接对应的数据库。
  • spring.rabbitmq.*:为RabbitMQ相关配置,连接RabbitMQ中间件。
  • logging.level.com.bizmda.bizsip:日志级别,一般设置为info。

三、启动应用

1 启动Sample App模块

运行sample/sampel-app模块下“SampleAppApplication.java”

2 启动Sample Sink模块

运行sample/sample-sink模块下“SampleSinkApplication.java”

3 启动Sample Source模块

运行sample/sample-source模块下“SampleSourceApplication.java”

4 启动Netty TCP Source模块(可选)

运行source/netty-source模块下“NettySourceApplication.java”

5 启动Sample App Log模块(可选)

运行sample/sample-app-log模块下“SampleAppLogApplication.java”

四、运行测试案例

$ sh ./test-all.sh 
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample1" -X POST --data '{"accountNo":"62001818","sex":"0","email":"123232@163.com","mobile":"18601872345"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   345    0   263  100    82    485    151 --:--:-- --:--:-- --:--:--   635
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample1",
  "traceId": "48109b6be28843a98f1d8c9aa9dcfffb",
  "parentTraceId": null,
  "timestamp": 1647483167921,
  "data": {
    "sex": "0",
    "mobile": "18601872345",
    "accountNo": "62001818",
    "email": "123232@163.com"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample1" -X POST --data '{"accountNo":"62001818","sex":"0","email":"123232@163.com","mobile":"18601872345"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   343    0   261  100    82  20076   6307 --:--:-- --:--:-- --:--:-- 26384
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample1",
  "traceId": "384282aee998445191dd6f257a349038",
  "parentTraceId": null,
  "timestamp": 1647483168187,
  "data": {
    "sex": "0",
    "mobile": "18601872345",
    "accountNo": "62001818",
    "email": "123232@163.com"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample2" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   238    0   219  100    19    414     35 --:--:-- --:--:-- --:--:--   450
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample2",
  "traceId": "9de1400b42824134896303eefeb6466e",
  "parentTraceId": null,
  "timestamp": 1647483168261,
  "data": {
    "message": "hello!",
    "accountNo": "003"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample2" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   236    0   217  100    19   3741    327 --:--:-- --:--:-- --:--:--  4140
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample2",
  "traceId": "a8fc16be2ca84dd1a1d7bd4994f347d8",
  "parentTraceId": null,
  "timestamp": 1647483168806,
  "data": {
    "message": "hello!",
    "accountNo": "003"
  }
}
curl -H "Content-Type:application/json" -X POST --data '{"accountNo":"003"}' http://localhost:8080/source1|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   236    0   217  100    19    489     42 --:--:-- --:--:-- --:--:--   531
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample2",
  "traceId": "bbfd45b2b5c04a1a980a5ee76b9f53d2",
  "parentTraceId": null,
  "timestamp": 1647483169262,
  "data": {
    "message": "hello!",
    "accountNo": "003"
  }
}
curl http://localhost:8080/hello?message=world
hello,worldcurl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/simple-xml-sink" -X POST --data '{"accountName": "王五","balance": 500,"accountNo":"005' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   301    0   243  100    58   1342    320 --:--:-- --:--:-- --:--:--  1662
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/simple-xml-sink",
  "traceId": "f95c9b68db904e6eac30d654b7f1255c",
  "parentTraceId": null,
  "timestamp": 1647483169446,
  "data": {
    "accountName": "王五",
    "balance": 500,
    "accountNo": "005"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-json-sink" -X POST --data '{"accountName": "王五","sex": "0","accountNo":"005"}' http://lalhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   300    0   246  100    54   2411    529 --:--:-- --:--:-- --:--:--  2941
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-json-sink",
  "traceId": "1168366a03444ebf95cecdd6c27c1aec",
  "parentTraceId": null,
  "timestamp": 1647483169632,
  "data": {
    "sex": "女",
    "account_no": "005",
    "account_name": "王五"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-json-sink" -X POST --data '{"accountName": "王五","sex": "1","accountNo":"005"}' http://lalhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   300    0   246  100    54   4730   1038 --:--:-- --:--:-- --:--:--  5769
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-json-sink",
  "traceId": "9a2ec11ddb6446b8aa355cc451f9c033",
  "parentTraceId": null,
  "timestamp": 1647483169772,
  "data": {
    "sex": "男",
    "account_no": "005",
    "account_name": "王五"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-json-sink" -X POST --data '{"accountName": "王五","sex": "2","accountNo":"005"}' http://lalhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   298    0   244  100    54   7176   1588 --:--:-- --:--:-- --:--:--  8764
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-json-sink",
  "traceId": "17b14c5b54eb4548912df2e74ddea582",
  "parentTraceId": null,
  "timestamp": 1647483169830,
  "data": {
    "sex": "?",
    "account_no": "005",
    "account_name": "王五"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-xml-sink" -X POST --data '{"accountName": "王五","sex": "0","accountNo":"005","balance":1}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   326    0   258  100    68   5265   1387 --:--:-- --:--:-- --:--:--  6791
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-xml-sink",
  "traceId": "b44d84c4092246b5ae4e2742d4d208a3",
  "parentTraceId": null,
  "timestamp": 1647483169931,
  "data": {
    "account": {
      "no": "005",
      "sex": "女人",
      "balance": 100,
      "name": "王五"
    }
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-xml-sink" -X POST --data '{"accountName": "王五","sex": "1","accountNo":"005","balance":10}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   328    0   259  100    69   8354   2225 --:--:-- --:--:-- --:--:-- 10580
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-xml-sink",
  "traceId": "0ea9bce56cb847a08420f04bd1ccc8ec",
  "parentTraceId": null,
  "timestamp": 1647483170010,
  "data": {
    "account": {
      "no": "005",
      "sex": "男人",
      "balance": 1000,
      "name": "王五"
    }
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-xml-sink" -X POST --data '{"accountName": "王五","sex": "2","accountNo":"005","balance":10}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   331    0   262  100    69   9703   2555 --:--:-- --:--:-- --:--:-- 12259
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-xml-sink",
  "traceId": "988d5d102b4c47ff818bc3abd9b04b97",
  "parentTraceId": null,
  "timestamp": 1647483170102,
  "data": {
    "account": {
      "no": "005",
      "sex": "不知道",
      "balance": 1000,
      "name": "王五"
    }
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/fixed-length-sink" -X POST --data '{"accountName": "王五","balance": 500,"accountNo":"005","sex":"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   345    0   277  100    68   5540   1360 --:--:-- --:--:-- --:--:--  7500
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/fixed-length-sink",
  "traceId": "e1583a62480c41e6a638365a29514ceb",
  "parentTraceId": null,
  "timestamp": 1647483170189,
  "data": {
    "accountName": "王五        ",
    "sex": "0",
    "balance": "500       ",
    "accountNo": "005     "
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/velocity-split-sink" -X POST --data '{"accountName": "王五","balance": 500,"accountNo":"005","sex"0"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   299    0   231  100    68   4914   1446 --:--:-- --:--:-- --:--:--  6361
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/velocity-split-sink",
  "traceId": "891e6a494c754ccfa0ee107873ff79e2",
  "parentTraceId": null,
  "timestamp": 1647483170270,
  "data": {
    "array": [
      [
        "0",
        "005"
      ],
      [
        "王五",
        "500"
      ]
    ]
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/iso-8583-sink" -X POST --data '{"msgType": "0800","reserved60": "000000000030","card_accptr_id42": "898411341310014","systemTraceAuditNumber11": "000001","switching_data62": "53657175656e6365204e6f3132333036303733373832323134","card_accptr_termnl_id41": "73782214","msgHead": "31323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536","acct_id_1_102": "1234567890","fin_net_data63": "303031"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   970    0   573  100   397  19100  13233 --:--:-- --:--:-- --:--:-- 32333
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/iso-8583-sink",
  "traceId": "5aed5303688441bd9a57d079a4d363f9",
  "parentTraceId": null,
  "timestamp": 1647483170372,
  "data": {
    "msgType": "0800",
    "reserved60": "000000000030",
    "card_accptr_id42": "898411341310014",
    "systemTraceAuditNumber11": "000001",
    "switching_data62": "53657175656e6365204e6f3132333036303733373832323134",
    "card_accptr_termnl_id41": "73782214",
    "msgHead": "31323031383430303031303334342020203432343330343430202020393031323334353637383930313233343536",
    "acct_id_1_102": "1234567890",
    "fin_net_data63": "303031"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/rabbitmq-connector-sink" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   233    0   214  100    19    428     38 --:--:-- --:--:-- --:--:--   466
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/rabbitmq-connector-sink",
  "traceId": "58e9b32a80b142b7840b3d0f9e1c101f",
  "parentTraceId": null,
  "timestamp": 1647483170453,
  "data": {
    "accountNo": "003"
  }
}
#echo '{"accountName": "王五","balance": 500,"accountNo":"xxx"}'|nc -l 10010
#curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample9" -X POST --data '{"accountNo":"999"}' http://localhost:8888/api|jq
echo '{"serviceId":"/script/sample2","accountNo":"003"}'|nc localhost 10020
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample10" -X POST --data '{"accountNo":"002"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   282    0   263  100    19    212     15  0:00:01  0:00:01 --:--:--   227
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample10",
  "traceId": "abc2729ef4ef4ce5959f50f0430ed2da",
  "parentTraceId": null,
  "timestamp": 1647483170987,
  "data": {
    "array": [
      {
        "accountName": "李四",
        "sex": "1",
        "balance": 200,
        "accountNo": "002"
      }
    ]
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample11" -X POST --data '{"accountNo":"002"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   240    0   221  100    19    225     19  0:00:01 --:--:--  0:00:01   244
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample11",
  "traceId": "39692a47de1d4c4998861d8ab105d11c",
  "parentTraceId": null,
  "timestamp": 1647483172235,
  "data": {
    "accountName": "002",
    "accountNo": "002"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample12" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   220    0   201  100    19   6483    612 --:--:-- --:--:-- --:--:--  7096
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample12",
  "traceId": "44958cbe722445ceb22ef492318dfa80",
  "parentTraceId": null,
  "timestamp": 1647483173229,
  "data": {
    "accountNo": "003"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample13" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   218    0   199  100    19   9476    904 --:--:-- --:--:-- --:--:-- 10900
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample13",
  "traceId": "7a92dcd193a64aeea42e6cc37d5bb075",
  "parentTraceId": null,
  "timestamp": 1647483173302,
  "data": {
    "accountNo": "003"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample14" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   527    0   508  100    19   3455    129 --:--:-- --:--:-- --:--:--  3585
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample14",
  "traceId": "9f216579704c4fe1b1e6e0114aa430d0",
  "parentTraceId": null,
  "timestamp": 1647483173388,
  "data": {
    "customerDTO": {
      "sex": "1",
      "customerId": "001",
      "name": "张三",
      "age": 20
    },
    "hello-sink": {
      "message": "hello!",
      "accountNo": "003"
    },
    "accountDTOs": [
      {
        "balance": 1200,
        "account": "0001"
      },
      {
        "balance": 45000,
        "account": "0003"
      }
    ],
    "accountDTOList": [
      {
        "balance": 3400,
        "account": "0002"
      },
      {
        "balance": 77800,
        "account": "0004"
      }
    ],
    "result1": "doService1() result"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample15" -X POST --data '{"maxRetryNum":2,"result":"success"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   252    0   216  100    36  19636   3272 --:--:-- --:--:-- --:--:-- 22909
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample15",
  "traceId": "9e8cbbf546614ca59227a8d46a2f311b",
  "parentTraceId": null,
  "timestamp": 1647483173547,
  "data": {
    "maxRetryNum": 2,
    "result": "success"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample16" -X POST --data '{"methodName":"doService1","params":["003"]}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   256    0   212  100    44   7571   1571 --:--:-- --:--:-- --:--:--  9142
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample16",
  "traceId": "63678580d0004013aa10abbd929d9344",
  "parentTraceId": null,
  "timestamp": 1647483173628,
  "data": {
    "result": "doService1() result"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample16" -X POST --data '{"methodName":"doService2","params":["003",1]}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   228    0   182  100    46  10111   2555 --:--:-- --:--:-- --:--:-- 12666
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample16",
  "traceId": "706d66b0a2e74983b045595584a37748",
  "parentTraceId": null,
  "timestamp": 1647483173720,
  "data": {}
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/sample16" -X POST --data '{"methodName":"queryCustomerDTO","params":["003"]}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   296    0   246  100    50  14470   2941 --:--:-- --:--:-- --:--:-- 17411
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/sample16",
  "traceId": "9a0f969a64164fe486a58e704f321ba3",
  "parentTraceId": null,
  "timestamp": 1647483173795,
  "data": {
    "result": {
      "sex": "1",
      "customerId": "001",
      "name": "张三",
      "age": 20
    }
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/hello-sink" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   239    0   220  100    19   9565    826 --:--:-- --:--:-- --:--:--  9958
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/hello-sink",
  "traceId": "a35462359a3644c1a86e070870a48ac9",
  "parentTraceId": null,
  "timestamp": 1647483173877,
  "data": {
    "message": "hello!",
    "accountNo": "003"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/sample17-sink" -X POST --data '{"accountName": "王五","sex": "0","accountNo":"005","balance":100}'ttp://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   322    0   254  100    68   9769   2615 --:--:-- --:--:-- --:--:-- 12384
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/sample17-sink",
  "traceId": "99929104934042a98d55555bace4dbd1",
  "parentTraceId": null,
  "timestamp": 1647483173970,
  "data": {
    "account": {
      "no": "005",
      "sex": "女人",
      "balance": 100,
      "name": "王五"
    }
  }
}
curl -H "Content-Type:application/xml" -X POST --data '<?xml version="1.0" encoding="UTF-8" standalone="no"?><root><accountName>王五</accountName><balance>500</balce><accountNo>005</accountNo></root>' http://localhost:8080/source4
<?xml version="1.0" encoding="UTF-8" standalone="no"?><root><accountName>王五</accountName><balance>500</balance><accountNo>005</accountNo></root>curl -H "Content-Type:application/json" -H "Biz-Service-Id:/sink/rabbitmq-sink" -X POST --data '{"accountName": "王五","sex": "0","accountNo":"005","balance":100}' http://localhost888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   257    0   189  100    68   9947   3578 --:--:-- --:--:-- --:--:-- 13526
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/sink/rabbitmq-sink",
  "traceId": "2adb278c249d4eb0868ed1ad8a9824e7",
  "parentTraceId": null,
  "timestamp": 1647483174215,
  "data": null
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample13" -X POST --data '{"accountNo":"62001818","sex":"0","email":"123232@163.com","mobile":"18601872345","key":"001","amount":1}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   477    0   372  100   105    189     53  0:00:01  0:00:01 --:--:--   242
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample13",
  "traceId": "eccc4fb5b52e4a4181c68f5344269c20",
  "parentTraceId": null,
  "timestamp": 1647483174311,
  "data": {
    "amount": 1,
    "sex": "0",
    "num": 1,
    "mobile": "18601872345",
    "count": 1,
    "preRatingValue": "pre-rating-script",
    "accountNo": "62001818",
    "ratingValue": "rating-script",
    "email": "123232@163.com",
    "key": "001"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/script/sample13" -X POST --data '{"accountNo":"62001818","sex":"0","email":"123232@163.com","mobile":"18601872345","key":"001","amount":1,"delete":1}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   499    0   383  100   116    338    102  0:00:01  0:00:01 --:--:--   440
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/script/sample13",
  "traceId": "e668ca47aa9e4fe4998cb22c81a04fa3",
  "parentTraceId": null,
  "timestamp": 1647483176295,
  "data": {
    "amount": 0,
    "sex": "0",
    "num": 1,
    "mobile": "18601872345",
    "count": 0,
    "delete": 1,
    "preRatingValue": "pre-rating-script",
    "accountNo": "62001818",
    "ratingValue": "rating-script",
    "email": "123232@163.com",
    "key": "001"
  }
}
curl -H "Content-Type:application/json" -H "Biz-Service-Id:/bean/long-tcp-netty" -X POST --data '{"accountNo":"003"}' http://localhost:8888/api|jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   348    0   329  100    19   1057     61 --:--:-- --:--:-- --:--:--  1122
{
  "code": 0,
  "message": "success",
  "extMessage": null,
  "appServiceId": "/bean/long-tcp-netty",
  "traceId": "01f5330aa9074910aa915bfb0902da08",
  "parentTraceId": null,
  "timestamp": 1647483177441,
  "data": {
    "accountNo": "003",
    "replyTo": "amq.rabbitmq.reply-to.g1h2AA5yZXBseUA3ODA0MzU4OAAAG8UAAAAxYdacFQ==.qiKaH0a4YMrWujP3/Ln1Ig==",
    "correlationId": "2"
  }
}

举报

相关推荐

0 条评论