郑华斌
2017-07-11 09:16:13 UTC
For service S, it has N apis, what's the best way to copy requests of specified apis and resend them to a message queue, without affecting the normal service?
Maybe there are following possible ways:
1) tcp copy: with tcp copy tools that copy requests on the server side, and redirect the copied flow to a fake server, there requests of different apis are send to message queue, in the format of api:serialized_request. But deploying is difficult because tcpcopy requires root permission.
2) develop a transport to wrapped current transport on server side, and send buffers to mq as well as call underline transport. But how to identify which api a request buffer belong to?
Any ideas?
Maybe there are following possible ways:
1) tcp copy: with tcp copy tools that copy requests on the server side, and redirect the copied flow to a fake server, there requests of different apis are send to message queue, in the format of api:serialized_request. But deploying is difficult because tcpcopy requires root permission.
2) develop a transport to wrapped current transport on server side, and send buffers to mq as well as call underline transport. But how to identify which api a request buffer belong to?
Any ideas?