TYK Pump and Middleware problem


I am using TYKPump and TYKGateway. I wrote a middleware. When the middleware was enabled, the pump did not write the contents of the raw_request and raw_response fields to elasticsearch. How can I fix this.

var InjectTidHeader = new TykJS.TykMiddleware.NewMiddleware({});
var tids = {};
tids["api.xx.com"] = "xx";
tids["api.bb.com"] = "bb";

InjectTidHeader.NewProcessRequest(function(request, session, config) {
    request.SetHeaders['X-TID'] = tids[request.Headers.Host];
	return InjectTidHeader.ReturnData(request, {});

I tried InjectTidHeader.ReturnData(request, session) and InjectTidHeader.ReturnData(request, session.meta_data), but couldn’t solve it.

Thank you.

Hi @rulucay, could you share the gateway logs, config file and api definition?