Comments (9)
Hi, we just released a new Subscriber API, which will make it much easier to debug this.
Would you mind upgrading your unleash-client-java to version 3.2.2?
With the new version you can register a custom UnleashSubscriber to log out what the unleash-client is actually doing internally:
UnleashConfig unleashConfig = new UnleashConfig.Builder()
.appName("java-test")
.instanceId("instance y")
.unleashAPI("https://unleash.herokuapp.com/api/")
.subscriber(new UnleashSubscriber() {
@Override
public void onReady(UnleashReady ready) {
System.out.println("Unleash is ready");
}
@Override
public void togglesFetched(FeatureToggleResponse toggleResponse) {
System.out.println("Fetch toggles with status: " + toggleResponse.getStatus());
}
@Override
public void togglesBackedUp(ToggleCollection toggleCollection) {
System.out.println("Backup stored.");
}
@Override
public void toggleBackupRestored(ToggleCollection toggleCollection) {
System.out.println("Backup read.");
}
})
.build();
Unleash unleash = new DefaultUnleash(unleashConfig);
When the client behaves as expected you should get something like this:
Backup read.
Fetch toggles with status: CHANGED
Backup stored.
Unleash is ready
Fetch toggles with status: NOT_CHANGED
Fetch toggles with status: NOT_CHANGED
....
And when a toggle is changing status in the UI / server you should see:
....
Fetch toggles with status: NOT_CHANGED
Fetch toggles with status: CHANGED
Backup stored.
Fetch toggles with status: NOT_CHANGED
....
With the custom Subscriber above, what is your output i the console?
from unleash-client-java.
2019-02-26 10:21:59.202 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Backup read.
10:21:59.202 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Backup read.
2019-02-26 10:21:59.895 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Fetch toggles with status: CHANGED
10:21:59.895 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: CHANGED
2019-02-26 10:21:59.900 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Backup stored.
10:21:59.900 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Backup stored.
2019-02-26 10:21:59.904 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Unleash is ready
10:21:59.904 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Unleash is ready
19-02-26 10:22:59.605 INFO 1652 --- [sh-api-executor] c.w..config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:22:59.605 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:24:05.733 INFO 1652 --- [sh-api-executor] c.w..config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:24:05.733 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:24:59.617 INFO 1652 --- [sh-api-executor] c.w..config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:24:59.617 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:26:00.718 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:26:00.718 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:27:05.745 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:27:05.745 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:27:59.881 INFO 1652 --- [sh-api-executor] c.w.submgn.config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:27:59.881 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:28:59.702 INFO 1652 --- [sh-api-executor] c.w..config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:28:59.702 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
2019-02-26 10:29:59.706 INFO 1652 --- [sh-api-executor] c.w..config.WebConfigurer : Fetch toggles with status: UNAVAILABLE
10:29:59.706 [INFO ] [no_tenant ] c.w.s.config.WebConfigurer - Fetch toggles with status: UNAVAILABLE
First request working 200 but
status code 400 is coming later on
UnleashConfig unleashConfig = UnleashConfig.builder()
.appName("XYZ")
.instanceId(UUID.randomUUID().toString())
.fetchTogglesInterval(60)
.disableMetrics()
.unleashAPI("http://localhost:"+env.getProperty("server.port")+"/api")
.subscriber(new UnleashSubscriber() {
@OverRide
public void onReady(UnleashReady ready) {
log.info("Unleash is ready");
}
@Override
public void togglesFetched(FeatureToggleResponse toggleResponse) {
log.info("Fetch toggles with status: " + toggleResponse.getStatus());
}
@Override
public void togglesBackedUp(ToggleCollection toggleCollection) {
log.info("Backup stored.");
}
@Override
public void toggleBackupRestored(ToggleCollection toggleCollection) {
log.info("Backup read.");
}
})
.build();
return new DefaultUnleash(unleashConfig);
Client version 3.2.2 as suggested
from unleash-client-java.
This is super wired!
Can you also override the onError
method on the subscriber and log out the full error message.
Could you inspect the logs of unleash-server also?
400 response typically implies that the server is not happy with the request.
I know multiple companies using the java client in production without issues (even my company, across 50+ java apps). I hope we can sort this out!
from unleash-client-java.
The problem is why it is working first time while taking backup , starts giving issues later
Do we have two end points in back end to fetch features data from server ?
from unleash-client-java.
when accessing my instance over AWS load balancer I would always get: HTTP/1.1 400 BAD_REQUEST.
Here are some findings given by someone i think this could be issue :
an empty header (no name and no value) because I had an empty row in HTTP Header Manager in jMeter. So, I persume, AWS ELB does some headers checking, and returns HTTP 400, even tough I wasn't having any problems with going with the same request to my instances directly. I don't know if this will help you but you should
from unleash-client-java.
This surprises me a lot. The initial request does indeed have an empty header, the If-None-Match
header is bootstrapped with an empty string.
This has been fixed in 3ea27de and released as 3.2.3
. I really hope this solves your issue.
Thanks for reporting, debugging help and your patience. 👍 🎉 🥇
from unleash-client-java.
it works , we can close this, t hanks for fixing this issue so fast......
from unleash-client-java.
...should probably add a null
check also before closing.
from unleash-client-java.
adressed in #72
from unleash-client-java.
Related Issues (20)
- Refactor DefaultUnleash to make it customizable with different implementation of IFeatureRepository HOT 1
- Sanitize appName for backupFile HOT 5
- Why use a `BiFunction` when the desired interface was a `BiPredicate`? HOT 1
- Unleash Codegen Gradle Plugin HOT 8
- DefaultUnleash.isEnabled(toggleName, context) silently dropping context HOT 4
- FakeUnleash enable all except certain features HOT 6
- Make Backuphandler extensible HOT 1
- Impression data flag as part of getFeatureToggleDefinition HOT 1
- Client specification header makes server send stale information HOT 12
- SDK exposes Api key in logs
- Missing 8.3.0 release artifact in maven HOT 3
- Strategy check return only the first enabled HOT 3
- Compatability Matrix HOT 2
- Update from 8.3.1 to 9.1.0 changes variant on existing features flags HOT 7
- Remove (again) our deprecated hashing methods
- Filter for tags HOT 2
- Add featureEnabled to variant response HOT 1
- Proxy authentication not working HOT 1
- String operator STR_STARTS_WITH is not evaluated correctly when case-sensative is disabled HOT 6
- FakeUnleash doesn't take into account global activation/deactivation for certain isEnabled method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unleash-client-java.