New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tags service discovery #737
Add tags service discovery #737
Conversation
Test are passing on my side only a timeout. |
I will take a look. |
Are you sure? The JsonMapper that ships with QBit is preconfigure to handle annotations. This works package io.advantageous.qbit.bugs;
import io.advantageous.boon.json.annotations.JsonProperty;
import io.advantageous.qbit.QBit;
import io.advantageous.qbit.json.JsonMapper;
import org.junit.Assert;
import org.junit.Test;
public class BoonBug352 {
@Test
public void test() {
Registration registration = new Registration();
registration.setName("name");
registration.setHost("localhost");
final JsonMapper mapper = QBit.factory().createJsonMapper();
String jsonSource = "{\"Name\":\"name\",\"Address\":\"localhost\"}";
Registration unserializedRegistration = mapper.fromJson(jsonSource, Registration.class);
String json = mapper.toJson(unserializedRegistration);
Assert.assertEquals(jsonSource, json);
}
public static class Registration {
@JsonProperty("Name")
private String name;
@JsonProperty("Address")
private String host;
public String getName() {
return name;
}
public Registration setName(String name) {
this.name = name;
return this;
}
public String getHost() {
return host;
}
public Registration setHost(String host) {
this.host = host;
return this;
}
}
} That said.. we should never output two fields. I will look into that. |
Ok.. I found the issue. |
Merge master into your branch and try it again. |
Thank for the patch it fixes the issue. Build and tests pass on my side. |
you are welcome.. thanks for contributing. |
Currently it's impossible to retrieve tags from service discovery or pass tags to an endpoint, this pull request allow to set tags then register them into service discovery provider. It also add host in Registration domain from Consul