Skip to content
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

Pr 826 #828

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/io/smallrye/stork/api/LoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface LoadBalancer {
* Select a single {@link ServiceInstance} from the given list.
*
* @param serviceInstances instances to choose from
*
*
* @return a ServiceInstance
*
* @throws NoServiceInstanceFoundException if the incoming collection is empty or all the service instances in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class NoServiceInstanceFoundException extends RuntimeException {

/**
* Creates a new NoServiceInstanceFoundException.
*
*
* @param message the error message
*/
public NoServiceInstanceFoundException(String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface ConfigWithType {

/**
* Load Balancer parameters.
*
*
* @return map of parameters of the load balancer
*/
Map<String, String> parameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@

/**
* Default value for the attribute. If not provided and user didn't set the value - null will be passed
*
*
* @return the default value
*/
String defaultValue() default Constants.DEFAULT_VALUE;

/**
* Description of the attribute. Works best in the documentation if it starts with a capital letter and ends with period.
*
*
* @return the description
*/
String description();

/**
* Whether the attribute is mandatory or optional
*
*
* @return true if the attribute is required, false otherwise
*/
boolean required() default false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public interface ServiceConfig {

/**
* ServiceDiscovery configuration for the service
*
*
* @return (required) service discovery configuration
*/
ConfigWithType serviceDiscovery();

/**
* Whether the communication should use a secure connection (e.g. HTTPS)
*
*
* @return true if SSL, TLS, etc. should be used for the communication
* @deprecated Use the service discovery 'secure' attribute instead
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@

/**
* Default value for the attribute. If not provided and user didn't set the value - null will be passed
*
*
* @return the default value
*/
String defaultValue() default Constants.DEFAULT_VALUE;

/**
* Description of the attribute. Works best in the documentation if it starts with a capital letter and ends with period.
*
*
* @return the description
*/
String description();

/**
* Whether the attribute is mandatory or optional
*
*
* @return true if the attribute is required, false otherwise
*/
boolean required() default false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@

/**
* Default value for the attribute. If not provided and user didn't set the value - null will be passed
*
*
* @return the default value
*/
String defaultValue() default Constants.DEFAULT_VALUE;

/**
* Description of the attribute. Works best in the documentation if it starts with a capital letter and ends with period.
*
*
* @return the description
*/
String description();

/**
* Whether the attribute is mandatory or optional
*
*
* @return true if the attribute is required, false otherwise
*/
boolean required() default false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public interface ElementWithType {
/**
* Gets the type.
*
*
* @return the type, must not be {@code null}, must not be blank
*/
String type();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

/**
* A provider for "utility" objects used by service discovery and load balancer implementations.
*
*
* The default implementation, {@code DefaultStorkInfrastructure} provides objects created by the passed supplier.
* Vendors can implement their own version of this class to provide custom objects.
*
*
* E.g. Quarkus uses a single Vert.x instance throughout the project and overrides this to return this Vert.x instance
*/
public interface StorkInfrastructure {
/**
* Get an instance of a "utility" class
*
*
* @param utilityClass class of the requested object
* @param defaultSupplier should be used by the implementation to create an object if the environment doesn't provide one,
* the result value can be cached.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public CachingServiceDiscovery(String refreshPeriod) {
/***
* Configures the period to keep service instances in the cache. Elements will be refetched after the given period.
* This method can be extended by the provider in order to change the logic for caching service instances.
*
*
* @param uni service instances retrieved from backing discovery source
* @return cached list of service instances in form of Uni
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void testInvalidConfig() {
Stork.initialize();
assertThatThrownBy(() -> Stork.getInstance().defineIfAbsent(null,
ServiceDefinition.of(new FakeConfiguration().withSecure("true"), new SingleConfiguration())))
.isInstanceOf(IllegalArgumentException.class);
.isInstanceOf(IllegalArgumentException.class);

assertThatThrownBy(() -> Stork.getInstance().defineIfAbsent("acme",
ServiceDefinition.of(null, new SingleConfiguration()))).isInstanceOf(IllegalArgumentException.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public StickyLoadBalancer(Duration failureBackOff) {

/**
* Selects the service instance
*
*
* @param serviceInstances instances to choose from
*
* @return the selected instance
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-parent</artifactId>
<version>38</version>
<version>43</version>
</parent>

<groupId>io.smallrye.stork</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CompositeServiceDiscovery implements ServiceDiscovery {

/**
* Creates a new CompositeServiceDiscovery
*
*
* @param serviceName the service name
* @param serviceNames the composed service names
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void shouldFailOnUnknownServiceDuringFirstLookup() {
assertThatThrownBy(() -> stork.getService("third-service")
.getInstances()
.await().atMost(Duration.ofSeconds(5))).isInstanceOf(NoSuchServiceDefinitionException.class)
.hasMessageContaining("second-service");
.hasMessageContaining("second-service");

stork.defineIfAbsent("second-service",
ServiceDefinition.of(new StaticConfiguration().withAddressList("localhost:8082")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum ConsulMetadataKey implements MetadataKey {

/**
* Creates a new ConsulMetadataKey
*
*
* @param name the name
*/
ConsulMetadataKey(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum DnsMetadataKey implements MetadataKey {

/**
* Creates a new DnsMetadataKey
*
*
* @param name the name
*/
DnsMetadataKey(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum EurekaMetadataKey implements MetadataKey {

/**
* Creates a new ConsulMetadataKey
*
*
* @param name the name
*/
EurekaMetadataKey(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ void shouldFailOnMissingService() {
void shouldFailOnInvalidFormat() {
assertThatThrownBy(() -> stork.defineIfAbsent("broken-service", ServiceDefinition.of(
new StaticConfiguration()
.withAddressList("localhost:8080, localhost:8081, , ")))).isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("Address not parseable");
.withAddressList("localhost:8080, localhost:8081, , "))))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("Address not parseable");
}

}
Loading