Great explanation of toggle features and the Togglz library! Your Amazon example perfectly illustrates the benefits of runtime control. I'll definitely be checking out this approach for my next project. Thanks for sharing!
00:00 Toggle Library cho phép kiểm soát tính năng thời gian chạy 02:57 Sử dụng Toggle Library để thay đổi tính năng trong thời gian chạy 05:40 Kích hoạt và xác thực các chuyển đổi tính năng trong Java 08:35 Bật và tắt các tính năng khi chạy 11:21 Bật và tắt các tính năng bằng Toggle Library 14:00 Chuyển đổi tính năng thời gian chạy cho phép thay đổi hành vi mà không cần thay đổi mã 16:23 Duy trì trạng thái tính năng bên ngoài bằng hệ thống tệp 18:57 Sử dụng thư viện chuyển đổi để kiểm tra các tính năng mới một cách an toàn Crafted by Merlin AI.
@@Javatechie if possible, could you make a video on Microservice observability like how actually micrometre project works, how it stores api hit etc does it directly communicate with server configs (devops things) or maintaining data at its end like filter nd own db etc. If possible to show the insight of that projects 🙏.
Hi Basant, thanks for the tutorial. But I have a couple of questions/request 1. If I want to enable/disable a feature across multiple layers (UI, BFF and Backend) how will it help here ? Because Admin console is attached to a particular microservice. 2. Since there is no database to keep the features, how will it ensure that multiple instances(pod) of a service will contain the same value(especially when we are updating one flag at runtime) ? I agree we can create a separate feature server for that 3. Can you please cover feature toggle in Java using Optimizely ?
can you please integrate with Spring security ? The one here is not production grade implementation and also not working when spring security integration is present. I tried for any documentation, but there are none. Seams to be a good candidate for your next video.
Great tutorial and very informative but I observed this won't work for the spring boot 3 versions. Can you create a video on how to create those FeatureManager configurations and also on the different strategies implementing part as well. Thanks.
Thank you i used springboot latest version(3.3.X) and togglz you mentioned versions in my local. i got below issue Field manager in OrderController required a bean of type 'org.togglz.core.manager.FeatureManager' that could not be found. i resolved this issue by used latest version(4.4.0) of both togglz.
Great explanation sir..But i have few questions. 1. Currently we are using vcap service in app express. I can add a variable in vcap service and i can switch there itself right? What's the difference between vcap service in app express and togglz? 2. This code will work only if i need ,5% discount right.. Suppose if i want 10% discount then this toggle will not work right?Again i need to do redeployment right?
Hi, Thanks for creating this video. Question : will the state of feature be saved as per the last value set during the case of redeployment of the pod/application? Thx
Is This updated with spring boot 3.3.x? I tried using Spring Boot 3.3.5 version error occured. Parameter 0 of constructor in id.my.hendisantika.featuretoggle.controller.ToggleController required a bean of type 'org.togglz.core.manager.FeatureManager' that could not be found.
Nice tutorial, incase my percentage of discount is random. different Pongal season different value, in that case how we will set that in feature. ?? i tried by adding and reading DISCOUNT_PERCENTAGE from feature properties' file but no luck.
Hi Basant, Thanks for your nice video on toggle feature. My only concern is how this feature can extensively used and under what scenarios it can be used. Since the admin of the application can set or unset the feature for the application in his web page, this feature usage is minimal or none. I feel that the setting of the various feature through web page by an authorized user is better.
Hi Sajeesh , let's take a small use case assume in ecommerce application i am loading location information from one 3rd party application but in future i want to fetch it from my DB instead of getting it from 3rd party app so i have implemented the code by pointing to DB but my project is live and i want to test my New implementation then how can I do that without decommissioning the 3rd party call? In this kind of situation the toggle switch will help you
Thank you for the video Basant! Can you please show us a good approach of monitoring our services. What is the best approach of monitoring everything related to our services? Is Datadog a good approach? Thank you in advance!
@@Javatechie Can you make a video on Prometheus and Grafana specially the query language , it would be really great as they are used in many good companies.
Buddy Single api call won't impact much on performance but still why should we go manual when we are getting this feature freely by just adding a dependency
@@Javatechie here also it's manual change only in ui or postman hit so both are manual ways in which u r enabling feature...same thing can be done in db flg which can be cached by in memory datastore which is centralised...and executing db update with central cache refresh for given feature key will reflect changes in all pods or instances...this is much more better approach than hitting postman or ui based updates on each pods or instances of application....with multi instance environment which is normal for prod...this thing if it's centralised thn only it's usable or effective else it's just not effective enough thn db centralised feature flag storage and updates in db as thts performance efficient
Hi Basant thanks for the video... I have a doubt... enabled is true in yml file but from console I have disabled it... then if my server is restarted then flag again enabled...right? If yes? What to do to get updated flag (false)?
Great tutorial and concise content. Thanks for the awesome video. Since most of the systems are distributed these days, not sure how this tool would be useful. Any thoughts ?
If the spring boot application is running on multi-pod cluster, will the toggle work for all pods? Or it will only toggle for the pod the postman http request went to?
Hi Basant, Could you please let me know which URL you are passing in the postman to update the status? If I will update it from postman do I need console library also ?
Hi i have tried below curl curl -d '{"name":"DISCOUNT_APPLIED", "enabled":"true"}' -H “Content-Type: application/json” -POST localhost:8080/actuator/togglz/DISCOUNT_APPLIED
@@Javatechie it could cause data inconsistency. For ex. If we have 3 services each with 5 replicas. Even if we fire an api to update the feature state in all 15 containers, due to network latency, pod availability or some internal error if the service doesn't update it's state it can cause request failures or could corrupt the DB. Having a central service holding these flags would be an ideal method, although there is a risk of single point of failure, there won't be data inconsistency is what I feel. How about you ?
"Togglz" is conceptually largely identical to "FF4j", though the APIs for querying the feature flags differ significantly as Togglz relies on Java enum as its primary means. "Unleash" is virtually identical to that of FF4j, and has probably more features than these other two. Worth considering, while chosing one out of these three.
Seems like a redundant library. We can achieve this without too much effort with some flags stored in memory at runtime. The solution this library is providing isn't that big of a problem to begin with. If a Software wants to toggle features at runtime, they will use the database or file to store the flags and would definitely avoid using any third party library for the same.
@@Javatechie If you don't use a permanent storage like fiile or a database, your flag will be reset everytimie you retart or redeploy the application. Don't want people to get free discounts by accident just cause we released a new version right ?
Cloned your repo. It doesn't work! th-cam.com/video/-FdegW8XX0c/w-d-xo.html works for me. It uses different dependency in pom.xml Thanks, your videos are always helpful
Great explanation of toggle features and the Togglz library! Your Amazon example perfectly illustrates the benefits of runtime control. I'll definitely be checking out this approach for my next project. Thanks for sharing!
00:00 Toggle Library cho phép kiểm soát tính năng thời gian chạy
02:57 Sử dụng Toggle Library để thay đổi tính năng trong thời gian chạy
05:40 Kích hoạt và xác thực các chuyển đổi tính năng trong Java
08:35 Bật và tắt các tính năng khi chạy
11:21 Bật và tắt các tính năng bằng Toggle Library
14:00 Chuyển đổi tính năng thời gian chạy cho phép thay đổi hành vi mà không cần thay đổi mã
16:23 Duy trì trạng thái tính năng bên ngoài bằng hệ thống tệp
18:57 Sử dụng thư viện chuyển đổi để kiểm tra các tính năng mới một cách an toàn
Crafted by Merlin AI.
Nice video , today i learned new thing using spring boot.
Keep uploading such videos.
Well explained Java Techie.,.... wonderful 😊
Très interessant
Thank you for great video
Thanks for wonderful information
Nice! 😁
Awesome, i remember we used to maintain enums and if else case. Nice now code is centralized 🙏. Nice happy weekend
Thanks Kavita Keep learning 😃
@@Javatechie if possible, could you make a video on Microservice observability like how actually micrometre project works, how it stores api hit etc does it directly communicate with server configs (devops things) or maintaining data at its end like filter nd own db etc. If possible to show the insight of that projects 🙏.
Sure Kavita let me Deep dive more into it then i will update 🙂
Great and thanks sir 🔥🔥
Hi Basant, thanks for the tutorial. But I have a couple of questions/request
1. If I want to enable/disable a feature across multiple layers (UI, BFF and Backend) how will it help here ? Because Admin console is attached to a particular microservice.
2. Since there is no database to keep the features, how will it ensure that multiple instances(pod) of a service will contain the same value(especially when we are updating one flag at runtime) ? I agree we can create a separate feature server for that
3. Can you please cover feature toggle in Java using Optimizely ?
Nice work 😊
Thank you.its good
Thank you Basant Sir
can you please integrate with Spring security ? The one here is not production grade implementation and also not working when spring security integration is present.
I tried for any documentation, but there are none. Seams to be a good candidate for your next video.
Great tutorial and very informative but I observed this won't work for the spring boot 3 versions. Can you create a video on how to create those FeatureManager configurations and also on the different strategies implementing part as well. Thanks.
Sure buddy i will.
This is wonderful , an u make some videos about distributed caching , service mesh and side cars.
No it's not there but I will plan for it .
Thank you
i used springboot latest version(3.3.X) and togglz you mentioned versions in my local.
i got below issue
Field manager in OrderController required a bean of type 'org.togglz.core.manager.FeatureManager' that could not be found.
i resolved this issue by used latest version(4.4.0) of both togglz.
Great explanation sir..But i have few questions.
1. Currently we are using vcap service in app express. I can add a variable in vcap service and i can switch there itself right? What's the difference between vcap service in app express and togglz?
2. This code will work only if i need ,5% discount right.. Suppose if i want 10% discount then this toggle will not work right?Again i need to do redeployment right?
Yes but your configuration should be always external to your project so redeployment not required
Hi will the state of feature be saved as per the last value set during the case of redeployment of the pod/application?
Yes i believe manually we need to store past state
Hi, Thanks for creating this video.
Question : will the state of feature be saved as per the last value set during the case of redeployment of the pod/application? Thx
I don't think so as those are stored in spring boot in-memory.
Hi Basant, are you using this library in your company? Is it allowed?
I have not used it but it is absolutely allowed as it is open source
@Autowired for FeatureManager is giving error saying: No beans of FeatureManager type found. How do i fix this?
Is This updated with spring boot 3.3.x?
I tried using Spring Boot 3.3.5 version error occured.
Parameter 0 of constructor in id.my.hendisantika.featuretoggle.controller.ToggleController required a bean of type 'org.togglz.core.manager.FeatureManager' that could not be found.
Hi Basant great video
Hello I am facing some issue ,can u pls resolve it ?
Consider defining a bean of type 'org.togglz.core.manager.FeatureManager' in your configuration.
I think FeaureManager works with spring boot 2.7.5 not with spring boot 3.0.0
Ohh is it . I will check and update
@@Javatechie thanks for replying
"Spring for apache kafka" + "Spring cloud stream", is equal to "Spring for apache kafka stream" ? What is difference?
No it's not equal i will cover that
Hi Bro, can we do Service now and Active Directory integrations. Pls suggest how can we integrate external apps like Data dog
Aravind you have asked 3 questions in a single response 😜. Tell me which one is priority for you 😉
@@Javatechie Service now integration and enable audit tracking, Thank you
Nice tutorial, incase my percentage of discount is random. different Pongal season different value, in that case how we will set that in feature. ?? i tried by adding and reading DISCOUNT_PERCENTAGE from feature properties' file but no luck.
No you can set the parameters dynamically to the toggle itself that will be my next video
Whenever the toggle is changed will it get logged in a DB? in prod , we need to know when was the toggle used and by whom
Toggle auditing i haven't tried need to check
Hi Basant, Thanks for your nice video on toggle feature. My only concern is how this feature can extensively used and under what scenarios it can be used. Since the admin of the application can set or unset the feature for the application in his web page, this feature usage is minimal or none. I feel that the setting of the various feature through web page by an authorized user is better.
Hi Sajeesh , let's take a small use case assume in ecommerce application i am loading location information from one 3rd party application but in future i want to fetch it from my DB instead of getting it from 3rd party app so i have implemented the code by pointing to DB but my project is live and i want to test my New implementation then how can I do that without decommissioning the 3rd party call? In this kind of situation the toggle switch will help you
@@Javatechie Thanks for your reply. I got your point. Only in such scenarios we can use toggle features else we can use admin setting the features.
Yes absolutely
As always the best tutorial. Can you please cover java code deployment on AWS EKS?
Yes buddy i will do that give me sometime
@@Javatechie - Take your time brother. :)
Thank you for the video Basant! Can you please show us a good approach of monitoring our services. What is the best approach of monitoring everything related to our services? Is Datadog a good approach? Thank you in advance!
Prometheus and grafana usually people use . I have not explored more on datadog buddy will check and update you
@@Javatechie Thank you!
@@Javatechie Can you make a video on Prometheus and Grafana specially the query language , it would be really great as they are used in many good
companies.
Yes buddy i will remake this
Hey great video, thanks for posting it, just one question that can't we do similar thing using manifests
Not getting how manifest file will help here
Hi, I was curious what is the benefit of this library over something like for example if I keep track of this variable in a db table?
If you will keep in the db then how do you toggle, definitely either you need to hit the api or run manual update query right?
@@Javatechie thanks for reply brother. Yes I meant having an api for this variable to toggle. Is this worse or better in terms of performance?
Buddy Single api call won't impact much on performance but still why should we go manual when we are getting this feature freely by just adding a dependency
@@Javatechie here also it's manual change only in ui or postman hit so both are manual ways in which u r enabling feature...same thing can be done in db flg which can be cached by in memory datastore which is centralised...and executing db update with central cache refresh for given feature key will reflect changes in all pods or instances...this is much more better approach than hitting postman or ui based updates on each pods or instances of application....with multi instance environment which is normal for prod...this thing if it's centralised thn only it's usable or effective else it's just not effective enough thn db centralised feature flag storage and updates in db as thts performance efficient
Hi Basant thanks for the video... I have a doubt... enabled is true in yml file but from console I have disabled it... then if my server is restarted then flag again enabled...right? If yes? What to do to get updated flag (false)?
No application restart won't impact much as based on your state it will behave
Hi Basant, can you upload introductory video on RedHat Decision Manager as well?
Great tutorial and concise content. Thanks for the awesome video.
Since most of the systems are distributed these days, not sure how this tool would be useful. Any thoughts ?
Thanks buddy. It will work for distributed system
If the spring boot application is running on multi-pod cluster, will the toggle work for all pods? Or it will only toggle for the pod the postman http request went to?
Even though it's multiple code still code where we are accessing feature management is the same right ?
Hi Basant, Could you please let me know which URL you are passing in the postman to update the status? If I will update it from postman do I need console library also ?
Hi i have tried below curl
curl -d '{"name":"DISCOUNT_APPLIED", "enabled":"true"}' -H “Content-Type: application/json” -POST localhost:8080/actuator/togglz/DISCOUNT_APPLIED
Thank you so much. It's really helpful as much as cool.
Can you help me difference between FF4j vs Togglz . Which one can i choose ? Is both or open source ?
What if we have this service replicated in a cluster, then how do we toggle a feature to affect multiple running replicas of this service?
Then you need to update in all replicas This is expected right
@@Javatechie is it an ideal solution in production environment ?
Yes ankith , what is the drawback? Why do you think it's not good for production?
@@Javatechie it could cause data inconsistency. For ex. If we have 3 services each with 5 replicas. Even if we fire an api to update the feature state in all 15 containers, due to network latency, pod availability or some internal error if the service doesn't update it's state it can cause request failures or could corrupt the DB. Having a central service holding these flags would be an ideal method, although there is a risk of single point of failure, there won't be data inconsistency is what I feel. How about you ?
Hi please make one video on method to toggle with FF4J so that we can able to toggle method depends on FF4J flipping strategy. Please make one video
Which one is good, FF4J or Togglz?
FF4j heard something new buddy let me check
@@Javatechie Sure, FF4J is feature flags for Java. It also flips features and does kind of similar things as togglz.
Awesome thanks for sharing this info Pratyush
"Togglz" is conceptually largely identical to "FF4j", though the APIs for querying the feature flags differ significantly as Togglz relies on Java enum as its primary means. "Unleash" is virtually identical to that of FF4j, and has probably more features than these other two. Worth considering, while chosing one out of these three.
Thanks! Excellent tutorial!
Can we pass the discount value from outside of the app using this toggle?
Yes we can set discount parameters dynamically using toggle i will do that in my next video
@@Javatechie thanks
We can achieve similar thing by using actuator refresh URL.
Feature toggling and actuator both are 2 different concept buddy. Didn't get you about refresh url
Can you give link for this using Java8?
Hi, how UI can use this feature flag
I have not tried the UI. Will check and update you
@@Javatechie any update on this.
How to add feature toggle feature at front end too
I will check and update not have much idea on UI
please check the unleashed and launchdarkly feature togger frameworks, that has capability of multiple technology stacks
@@Javatechie Thanks
Hi Basant why did you remove my comment yar, i did not write anything wrong infact suggested some more new technologies
May I know what are those new technologies??
Hey sparkDev sorry for the inconveniences. By mistake it was deleted please don't mind and repost
@@sivannarayanapenumala1840 those are LaunchDarkly and unleash. Where unleash is.opensource and LaunchDarkly is paid
Seems like a redundant library.
We can achieve this without too much effort with some flags stored in memory at runtime.
The solution this library is providing isn't that big of a problem to begin with. If a Software wants to toggle features at runtime, they will use the database or file to store the flags and would definitely avoid using any third party library for the same.
If you will use the database then to toggle any features you need to trigger a query right? Either manually or through api to update the flag value
@@Javatechie If you don't use a permanent storage like fiile or a database, your flag will be reset everytimie you retart or redeploy the application.
Don't want people to get free discounts by accident just cause we released a new version right ?
Yes that's what I was trying to convince you to maintain your State of features external to your application like database or file
Distributed application you need to keep this in Reds
Thanks
Cloned your repo. It doesn't work!
th-cam.com/video/-FdegW8XX0c/w-d-xo.html works for me. It uses different dependency in pom.xml
Thanks, your videos are always helpful