RTBStack: New Adapter (Port from GO)#4552
Open
ChrisHuie wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Type of changes
✨ What's the context?
This PR ports the RTBStack bid adapter from PBS-Go to PBS-Java. RTBStack is Admixer's RTB platform; the adapter sends standard OpenRTB 2.6 server-to-server bid requests so PBS publishers can access RTBStack demand. It is the Java counterpart of the merged Go adapter prebid/prebid-server#4685. Closes #4497.
Scope:
appandsite).modifying-vast-xml-allowed: false— declared explicitly to preserve the Go adapter's effective value (the field is absent in the Go config where the default isfalse, while the Java adapter-default istrue).🧠 Rationale behind the change
Bidder params (
imp[].ext.prebid.bidder.rtbstack; the params JSON schema is byte-identical to the Go side's):route(string, required, minLength 1) — a routing URL supplied per ad unit. The adapter derives the outgoing endpoint from it and never calls it directly.tagId(string, required) — promoted toimp.tagid.customParams(object, optional) — arbitrary targeting values forwarded to the exchange.Request building mirrors the Go adapter:
routevalue, preserving first-seen order; imps whose ext fails to parse are skipped with abadInputerror while the rest proceed.<region>-adx-admixerlabel whose region is validated against the fixed allow-list {us,eu,sg}, and theclient/endpoint/sspquery params are required. The values fill the{{Region}}/{{SspID}}/{{ZoneID}}/{{PartnerId}}macros of the endpoint configured inbidder-config/rtbstack.yaml(parent domain pinned there; query values are url-encoded on substitution), so the outgoing host can never be an arbitrary request-supplied hostname. A group with an invalid route (unparseable, region not in the allow-list, or missing query params) is rejected withbadInputwithout affecting other groups.imp.extis replaced with only the optionalcustomParamsobject (empty maps are dropped, matching the Go wire format), andsite.domainis derived fromsite.pagewhen blank — hostname when one can be extracted, otherwise the raw page value, exactly as the Go adapter does.Bid type resolution treats
bid.mtype(OpenRTB 2.6) as authoritative and strict: 1/2/3/4 → banner/video/audio/native; a bid with a missing or unsupportedmtypesurfaces abadServerResponseerror and is skipped while other bids in the response continue to be processed. There is no imp-based or default fallback, matching the Go adapter.gvlVendorIDis511(Admixer EU GmbH), carried over from the Go config, so EU/TCF consent is enforced against that vendor ID.🔎 New Bid Adapter Checklist
<region>-adx-admixer.rtb-stack.comwith the parent domain pinned in the endpoint config and region constrained to the {us, eu, sg} allow-listrouteparam; the host operator configures a single endpointtagIdpromotion with animp.extrepack,site.domainderivation, and strict mtype-based bid typing, so a dedicated adapter is warranted🧪 Test plan
RtbStackBidderTest— 29 unit tests covering endpoint resolution for all three regions, url-encoding of substituted query values, route grouping and batching order (distinct routes, repeated routes), partial-failure tolerance (invalid imp ext, invalid region, missing query params, unparseable route — each alongside a healthy imp/route), theimp.extrepack including the fullcustomParamsvalue-type matrix and empty-map drop,site.domainderivation with its fallbacks, and the completegetBidTypematrix (all four media types, unsupported and missing mtype, mixed valid/invalid bids, currency passthrough). JaCoCo reports 100% line coverage onRtbStackBidder.RtbStackTestintegration test — exercises the full auction path against WireMock and validates the adapter configuration is reachable.mvn test(full suite) andmvn checkstyle:checkpass locally.🏎 Quality check
Source Go adapter: prebid/prebid-server#4685 (merged 2026-05-13). The
prebid.github.iobidder doc (dev-docs/bidders/rtbstack.md) is already live withpbs: true, so no companion docs PR is needed.Please add the
do not portlabel per the porting guide (I do not have label permissions on this repo).