Git Product home page Git Product logo

registry-aware-jersey-client's People

Contributors

chrisrohr avatar dependabot[bot] avatar github-actions[bot] avatar sleberknight avatar

Watchers

 avatar  avatar  avatar

registry-aware-jersey-client's Issues

Add headerSupplier to DropwizardManagedClientBuilder

RegistryAwareClientBuilder provides the headersSupplier builder method, which provides a way to specify that the given "header supplier" should be used to add request headers to all client requests.

We should add this same ability in the DropwizardManagedClientBuilder.

Fix incorrect log message in RegistryAwareClientBuilder#build

The incorrect log message is:

if (!sslContextWasSetOnThis) {
    LOG.info("No SSLContext provided; this client will use system default TLS via SSLConnectionSocketFactory.getSocketFactory()");
}

If an SSLContext is not set, then one is not used.

Alternatively, we could actually do what the log message says instead, but is that a good default?

Log warning in DropwizardManagedClientBuilder if TlsConfigProvider cannot provide

Currently in DropwizardManagedClientBuilder#newDefaultJerseyClientConfiguration:

If the caller supplies a non-null TlsConfigProvider...

and that provider's canProvide() returns false...

we skip setting the TlsConfiguration on the JerseyClientConfiguration...

but we don't provide any feedback on this situation...

which is presumably not what the caller intended.

This task is to simply log at WARN level the fact that:

  1. A non-null TlsConfigProvider was supplied, but...
  2. It cannot provide TLS configuration values...
  3. So we are unable to set the TLS configuration on the JerseyClientConfiguration

Add slf4j-api and logback-classic back into POM

kiwi-parent 2.0.0 removed slf4j-api and logback-classic and they are now controlled only in the BOM (kiwi-bom). So, they need to be explicitly added back to the POM, but don't need version specified. slf4j-api should be compile scope (default) and logback-classic should be test scope.

Add factory method to ServiceIdentifier to create for given service name

Most of the time, in our (Dropwizard) configuration classes, we simply use

@NotNull
@Value
private ServiceIdentifier myServiceId = ServiceIdentifier.builder().serviceName("my-service").build();

which is rather verbose. Instead, we should provide a simple factory method to permit something like this:

@NotNull
@Value
private ServiceIdentifier myServiceId = ServiceIdentifier.ofName("my-service");

Not sure whether ofName should be the name, or maybe application to indicate it creates an instance with an APPLICATION connector type. ServiceIdentifier.application("my-service") doesn't seem as clear, though ofName doesn't indicate the connector type. Or maybe just ServiceIdentifier.of("my-service") which would allow for also having ServiceIdentifier.of("my-service", PortType.ADMIN) if we wanted.

Make MissingServiceRuntimeException public

Consider moving to a top-level class.

Also consider moving the static factory method newMissingServiceRuntimeException into the exception. Might want to rename it, e.g.

throw new MissingServiceRuntimeException.from(serviceIdentifier);

Manage kiwi and kiwi-test dependency versions

Currently when we release retrying-again, kiwi, and kiwi-test it forces us to release all our other libraries in kiwiproject. As long as the updates to these pure utility libraries are 100% backwards compatible, then it should be safe to update them without having to update every other library.

This task is to add a dependencyManagement section to the POM to control the version of these libraries and avoid all the downstream convergence errors. It will allow us to release them on a more frequent cadence, since they are the ones that change more frequently.

Fix test that breaks in Jackson 2.15.x and higher

The specific test that starts failing is DropwizardClientsTest.AddJacksonMessageBodyProvider#shouldDeserializeJsonResponses

Once on Jackson 2.15.x, change the code in the newSamplePerson test helper method which sets the createdAt and updatedAt properties from:

ZoneId.of("UTC")

to

ZoneId.of("UTC").normalized()

We could also use ZoneOffset.UTC but I think the normalized() method makes it a bit more clear, especially once you go read its javadoc.

We can also extract ZoneId.of("UTC").normalized() to a local variable instead of repeating ourselves, e.g.

var utc = ZoneId.of("UTC").normalized();
// ...
    .createdAt(ZonedDateTime.of(..., utc))
    .updatedAt(ZonedDateTime.of(..., utc))
// ...

See here for more details: kiwiproject/kiwi-bom#655 (comment)

Add manual workflow to Delombok and print Java sources

This workflow will allow us to easily Delombok the code and view the resulting source code.

This will help when diagnosing CodeQL problems since it references line numbers in Delomboked source files.

The workflow should be manually triggered.

Add a copyOf method to ServiceIdentifier

We can copy a ServiceIdentifier instance using:

var copy = serviceId.toBuilder().build();

This is most useful when you want to change something, e.g.

var newServiceId = serviceId.toBuilder()
    .preferredVersion("2020.12.01")
    .build();

But when all we want is an exact copy and not to change anything it would be nice to be able to do:

var copy = ServiceIdentifier.copyOf(serviceId);

Add Client builders

This will add the following:

  1. ClientBuilder (interface)
  2. RegistryAwareClientBuilder (impl)
  3. ClientBuilders (factory)

Add more options to RegistryAwareClient

We currently have a targetForService which sets up the WebTarget using the service instance's hostname, application port and home page url. It would be nice to have at least the following option to request data from the admin port:

public WebTarget adminTargetForService(ServiceIdentifier serviceIdentifier)

This will setup the WebTarget with the hostname and admin port but then let the caller set the path. We could also add:

public WebTarget adminStatusTargetForService(ServiceIdentifier serviceIdentifier) and public WebTarget adminHealthCheckTargetForService(ServiceIdentifier serviceIdentifier) that will utilize the other path objects in the ServiceInstance to set the base target.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.