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. :-)
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 🙏🏻
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. :-)
why are you using @RequestScoped for class TenantContext?
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 🙏🏻
thanks!