Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mitch Kent
@spudtheimpaler
Unfortunately is quite tightly tied to our framework otherwise I'd share it...
Christian Kaltepoth
@chkal
@spudtheimpaler Thanks for sharing these details!
Joshua White
@joshuawhite929
Hello. New to togglz, and had a couple of questions on things I haven’t found in the docs
Specifically looking at the boot starter stuff... are there dependencies on Spring MVC or the availability of a servlet Container?
For example, what if I was using Springs reactive stack and netty?
Christian Kaltepoth
@chkal
Togglz Core doesn't depend on Servlet, for the Spring Boot Starter I'm not sure. Maybe @ruifigueira can answer that?
Rui Figueira
@ruifigueira
@joshuawhite929 , some components like the togglz console depend on servlets, but they are optional, and should only be loaded in a spring boot app if servlet classes are found in the classpath. So I would say that
It should work with a non-servlet setup. If you find any issues let us know
Joshua White
@joshuawhite929
@ruifigueira , thanks for the answer
I have another question though. When looking at the Spring Boot application properties for togglz (see https://www.togglz.org/documentation/spring-boot-starter.html), I mentions the use of a property called feature-enums
I have set up two different feature enum implementation classes without using this and they seem to be found just fine
is this because the isActive() method is calling FeatureContext.getFeatureManager().isActive(this);?
is the feature-enums property only needed when you are not using the FeatureContext in your enum class?
Its not clear when you should be using feature-enums
Christian Kaltepoth
@chkal
Hey all. Togglz is looking for a new maintainer. See this mail for details: https://groups.google.com/forum/#!topic/togglz-dev/4eL0tAO3q-A
Rui Figueira
@ruifigueira
@chkal, I just wanted to thank you, Togglz is a great tool. I totally understand your reasons, and I wish you all the best
Rui Figueira
@ruifigueira
From my part, I'll try to keep Spring modules updated
Rui Figueira
@ruifigueira
@joshuawhite929 , the feature-enums property is required if you actually want to register them in the FeatureManager, otherwise you will always get the default value, which seems to be the case. For instance, if you activate the Togglz console, it won't list your features unless they are registered.
Joshua White
@joshuawhite929
@ruifigueira I haven looked at the source yet, but I was wondering if the call to ‘FeatureContext.getFeatureManager().isActive(this);’ would also register the feature class if it hadn’t been already. I ask because I am able to toggle values without explicitly registering my feature class
Rui Figueira
@ruifigueira
I don't think it does, you need to provide your class to FeatureManager explicitly. You can get values from unregistered features, but they won't be persisted, for instance
Christian Kaltepoth
@chkal
@ruifigueira Awesome! Thanks a lot!
Alfred Feldmeyer
@byteSamurai

Hey everybody,

Rooky question here: Is it correct that in Junit - if not defined differently - we use the FallbackTestFeatureManager, which will set all features to enabled? Why is this so?

RoopeshMajeti
@RoopeshMajeti
Hi all. Congrats to @bennetschulz for being the new maintainer for togglz project.
loicraux
@loicraux
Hi there !
Is that an appropriate channel for support on togglz library ? I have some trouble w/ the conf & usage of togglz with a multi maven module app...
Christian Kaltepoth
@chkal
@loicraux I don't think that there are many active users here. You should file an issue on GitHub instead.
debrutal
@debrutal
Hi, are there any options to have togglz within a reactive server like netty? Usecase: I use spring api-gateway which uses netty under the hood to consume requests. Currently i am only aware of a servlet implementation 'togglz-console'. Since it requires a servlet container, this is not an option. Second question: am i able to access the feature state within a reactive server?
akashch66
@akashch66
@here I have a question about Togglz. Can we connect to Oracle DB for JDBCStateRepository implementation ?
Christian Kaltepoth
@chkal
@akashch66 Yes, AFAIK this should work fine.
akashch66
@akashch66
@chkal Thanks for your reply. One more question, what is the exact difference between InMemoryStateRepository and CacheStateRepository
Christian Kaltepoth
@chkal
@akashch66 InMemoryStateRepository is a special repository which holds feature state in memory. So it doesn't really persist updates to the feature state, because they are lost after restarting the application. CacheStateRepository is a cache and wraps the "real" state repository. It tries to minimize calls to the real state repository and is very useful if reading and writing the underlying state repository is expensive. A common setup is to use CacheStateRepostory and JDBCStateRepostiory together to minimize the total number of database queries.
Christian
@anno1985
Hi! Is it possible to inject the TestFeatureManager into methods annotated with JUnit 5's @BeforeEach (as works for the test methods)? If not, what would be necessary to set one up manually and pass around to test methods via test class field?
Christian
@anno1985
Adding the @AllDisabled(MyFeaturesEnum::class) annotation on class level does the trick. :)
Bennet Schulz
@bennetelli

Hi there,

sorry.. I wasn't active in gitter before, but I will be if there is an interest in it. Otherwise I would like to move discussions to GitHub issues/mails/twitter.
So do you think this gitter channel is useful?

Rafal84Dev
@Rafal84Dev
Hello, Would it be possible to make this class TogglzTestExecutionListener to have not implement Order with the LOWEST_PRECEDENCE ? When integrating with Spock and playing with own annotations features are always overriden by TogglzTestExecutionListener to default values as it is fired last. If it had set some higher Order I could setup own TestExecutionListner that would do its job. Currently it is not possible as TogglzTestExecutionListener is always the last one.
Bennet Schulz
@bennetelli
Hey @Rafal84Dev thanks for your question. I will give it a try either today or tomorrow.
Bennet Schulz
@bennetelli
@Rafal84Dev i just tried t ochange it to HIGHEST_PRECEDENCE and it seems to work. Will contribute it this evening and release a new version of togglz this week.
Milan Deket
@mdeket_gitlab
Hello :) Is it possible to add togglz feature on @PreAuthorize spring security annotation?
Bennet Schulz
@bennetelli
Hey @mdeket_gitlab to be honest: I've never tried it in combination with PreAuthorize.
You could contribute an example to the togglz-sample project if you have time to test it :)
Otherwise I can put it in the issues section on github and try it later.
Milan Deket
@mdeket_gitlab
Well, the problem is that I didn't manage to use togglz with PreAuthorize. For example to have two annotations above the controller method, @TogglzAnnotation and @PreAuthorize. The problem is that each time @PreAuthorize is executed first. Maybe I need to find different approach to this, I'm not sure
Bennet Schulz
@bennetelli
@mdeket_gitlab not sure about it. what is your use case? What do you want to do with @PreAuthorize?
Milan Deket
@mdeket_gitlab
I want to enable or disable authorization on a specific endpoint using togglz.
Ruth
@huehnerlady
Hi, I created 2 Pull REquests with some ideas. Who could I ask to review this? Unfortunately there are no codeowners in the repository and I cannot find a 'contributing' readme:)
Bennet Schulz
@bennetelli
Hey Ruth, thanks for your pull requests :)
I will review it
1 reply
Bajal
@bajalnyt
Hello, I was trying out the togglz-spring-boot-starter and everything works well out of the box, except I can't get to the http://localhost:8080/actuator/togglz endpoint. What could be the problem
Bennet Schulz
@bennetelli_twitter
Hey @bajalnyt, did you enable all endpoints in the application.properties / application.yml?
Bajal
@bajalnyt

@bennetelli_twitter , this is what I had added:

togglz.endpoint.enabled=true
togglz.endpoint.id=togglz

repo is here: https://github.com/bajalnyt/togglz-demo

Bennet Schulz
@bennetelli
@bajalnyt shit :/ you are right. There is no integration test to check if this works as it should :( sorry..