com.opentable.components:otj-jaxrs-client

This is the Base POM for open source OpenTable Maven projects.

Categories

Categories

CLI User Interface
GroupId

GroupId

com.opentable.components
ArtifactId

ArtifactId

otj-jaxrs-client
Last Version

Last Version

1.7.0
Release Date

Release Date

Type

Type

jar
Description

Description

This is the Base POM for open source OpenTable Maven projects.

Download otj-jaxrs-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.opentable.components/otj-jaxrs-client/ -->
<dependency>
    <groupId>com.opentable.components</groupId>
    <artifactId>otj-jaxrs-client</artifactId>
    <version>1.7.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.opentable.components/otj-jaxrs-client/
implementation 'com.opentable.components:otj-jaxrs-client:1.7.0'
// https://jarcasting.com/artifacts/com.opentable.components/otj-jaxrs-client/
implementation ("com.opentable.components:otj-jaxrs-client:1.7.0")
'com.opentable.components:otj-jaxrs-client:jar:1.7.0'
<dependency org="com.opentable.components" name="otj-jaxrs-client" rev="1.7.0">
  <artifact name="otj-jaxrs-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.opentable.components', module='otj-jaxrs-client', version='1.7.0')
)
libraryDependencies += "com.opentable.components" % "otj-jaxrs-client" % "1.7.0"
[com.opentable.components/otj-jaxrs-client "1.7.0"]

Dependencies

compile (10)

Group / Artifact Type Version
com.opentable.components : otj-jaxrs-shared jar 1.7.0
com.opentable.components : otj-config jar 1.3.2
com.fasterxml.jackson.core : jackson-databind jar 2.4.6
com.fasterxml.jackson.jaxrs : jackson-jaxrs-json-provider jar 2.4.6
org.skife.config : config-magic jar 0.17
com.google.guava : guava jar 18.0
com.google.code.findbugs : annotations jar 3.0.0
org.slf4j : slf4j-api jar 1.7.12
javax.inject : javax.inject jar 1
javax.ws.rs : javax.ws.rs-api jar 2.0

test (1)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.12

Project Modules

There are no modules declared in this project.

OpenTable JAX-RS Component

Build Status

Notes

  • otj-jaxrs-exception is considered deprecated. Please do not use it in newer projects (although we will continue to support it indefinitely)

Component Charter

  • Provides bindings from a JAX-RS Client provider into the Spring, configuration, and otj-server ecosystem.
    • Can swap out Jersey for RESTEasy
    • Register Features with Spring DI environment
  • Brings in otj-jackson support for directly reading and writing JSON.

Component Level

Installation

  • Add the otj-jaxrs-client and otj-jaxrs-shared maven dependencies
  • Choose an engine (otj-jaxrs-clientfactory-resteasy, otj-jaxrs-clientfactory-jersey, otj-jaxrs-clientfactory-resteasy-apache).

Normally otj-jaxrs-clientfactory-resteasy (which is RestEasy + Jetty client) is used in otj-server. This is still the recommended choice.

otj-clientfactory-jersey is considered legacy and not regularly tested. We don't recommend it. Let us know if you need it.

otj-clientfactory-resteasy-apache - Is RestEasy + Apache Http Engine. We don't recommend this currently, but we are keeping this around, as Apache has a few options Jetty doesn't support.

Configuration

The JAX-RS client configuration is managed through your application properties.

See JaxRSClientConfig for the list of options. Note many options are only supported by specific engines. It's a bit of a mess, frankly, which eventually we'll clean up.

Options are configured using the provided client name and the corresponding jaxrs configuration:

jaxrs.client.${clientName}.option=value

For the client name "availability" the corresponding connection pool configuration option will be:

jaxrs.client.availability.connectionPool=50

For configuration options that take time, use the ISO 8601 Durations format (https://en.wikipedia.org/wiki/ISO_8601).

Example: Configure the connection timeout to 5s

jaxrs.client.availability.connectTimeout=PT5s

For values smaller than seconds you may use decimals per the ISO 8601 format:

"The smallest value used may also have a decimal fraction, as in "P0.5Y" to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in "P0,5Y" or "P0.5Y"."

To configure a connection timeout of 150ms:

jaxrs.client.availability.connectTimeout=PT0.150s

For a list of configurable options see client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java


Copyright (C) 2019 OpenTable, Inc.

com.opentable.components

OpenTable

Restaurant Reservations

Versions

Version
1.7.0
1.6.0
1.5.2
1.5.1
1.5.0