use of com.amazonaws.xray.config.DaemonConfiguration in project aws-xray-sdk-java by aws.
the class UDPEmitterTest method getDaemonConfiguration.
protected DaemonConfiguration getDaemonConfiguration(final String address) {
DaemonConfiguration config = new DaemonConfiguration();
config.setDaemonAddress(address);
return config;
}
use of com.amazonaws.xray.config.DaemonConfiguration in project aws-xray-sdk-java by aws.
the class XRayClient method newClient.
/**
* @deprecated aws-xray-recorder only supports communicating with the X-Ray daemon, which does
* not require the usual AWS API signatures so we have stopped using the SDK X-Ray client.
*/
@Deprecated
public static AWSXRay newClient() {
DaemonConfiguration config = new DaemonConfiguration();
ClientConfiguration clientConfig = new ClientConfiguration().withRequestTimeout(TIME_OUT);
AwsClientBuilder.EndpointConfiguration endpointConfig = new AwsClientBuilder.EndpointConfiguration(config.getEndpointForTCPConnection(), DUMMY_REGION);
return AWSXRayClientBuilder.standard().withEndpointConfiguration(endpointConfig).withClientConfiguration(clientConfig).withCredentials(// This will entirely skip signing too
ANONYMOUS_CREDENTIALS).build();
}
use of com.amazonaws.xray.config.DaemonConfiguration in project aws-xray-sdk-java by aws.
the class UDPEmitterTest method sendingSegmentShouldNotThrowExceptions.
@Test
void sendingSegmentShouldNotThrowExceptions() throws SocketException {
DaemonConfiguration config = getDaemonConfiguration("__udpemittertest_unresolvable__:1234");
UDPEmitter emitter = new UDPEmitter(config);
boolean success = emitter.sendSegment(new DummySegment(getGlobalRecorder()));
assertThat(success).isFalse();
}
use of com.amazonaws.xray.config.DaemonConfiguration in project aws-xray-sdk-java by aws.
the class UDPEmitterTest method testCustomAddress.
@Test
void testCustomAddress() throws SocketException {
String address = "123.4.5.6:1234";
DaemonConfiguration config = getDaemonConfiguration(address);
UDPEmitter emitter = new UDPEmitter(config);
assertThat(emitter.getUDPAddress()).isEqualTo(address);
}
Aggregations