简体   繁体   中英

What is the best way to delegate requests from third party servers?

We have a third party company that we communicate with; we send them an information request, they send some information back. The issue is that right now, we only have this working on the production server. We have several other servers (dev, staging, uat, content editing) that need to make use of this information. So I make call to the third party with any server, they respond and I need a way to figure out which of our servers made the request.

The third party company will not change their code; we can give them a single server end point to respond to.

I know I can probably write something that does this, but I figure there is something that already does this and I am just not searching for the right terms.

I am using Java with Apache Tomcat.

Let's divide your problem into two problems.

Your essential problem is splitting the traffic. You can use a tool like Gor for this purpose. I found this tool from here .

Your other problem is filtering: guaranteeing that your traffic goes to the correct destination. This is when you can't simply send all of the traffic to all possible destinations. Some common reasons include high volume or sensitive data.

Filtering is highly dependant on your particular domain, so I don't believe there are any out of box implementations. However, scripting it should be fairly straightforward.

If and how you can do filter the data depends on the API. Sometimes the API generates an unique identifier for each request that you make. Some other API-s let you generate an unique identifier yourself.

For example you can do the outgoing request through some two-way proxy that will remember the machine and unique identifier, and then the proxy filters any incoming requests by that unique identifier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM