4 Comments
User's avatar
Nicolas Duminil's avatar

Very interesting. I tested it and it works as expected. That's really awsome how nip.io maps the IP addresses. I'm not sure to have understood how it does that. It's probably ... just magic. :-)

nn's avatar

why are you using @RequestScoped for class TenantContext?

Markus Eisele's avatar

I needed a way to pass the Tenant from Filter to Resource. The easy way is to make it a request scoped CDI bean. There are other alternatives. You could either use ThreadLocal or store the TenantContext in the ContainerRequestContext. But the CDI approach is type-safe, managed and has a clean API. I prefer this usually. Hope this answers your question! If not, please let me know! And thanks for reading 🙏🏻

nn's avatar

thanks!