Search in sources :

Example 1 with DaemonConfiguration

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;
}
Also used : DaemonConfiguration(com.amazonaws.xray.config.DaemonConfiguration)

Example 2 with DaemonConfiguration

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();
}
Also used : DaemonConfiguration(com.amazonaws.xray.config.DaemonConfiguration) AwsClientBuilder(com.amazonaws.client.builder.AwsClientBuilder) ClientConfiguration(com.amazonaws.ClientConfiguration)

Example 3 with DaemonConfiguration

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();
}
Also used : DummySegment(com.amazonaws.xray.entities.DummySegment) DaemonConfiguration(com.amazonaws.xray.config.DaemonConfiguration) Test(org.junit.jupiter.api.Test)

Example 4 with DaemonConfiguration

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);
}
Also used : DaemonConfiguration(com.amazonaws.xray.config.DaemonConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

DaemonConfiguration (com.amazonaws.xray.config.DaemonConfiguration)4 Test (org.junit.jupiter.api.Test)2 ClientConfiguration (com.amazonaws.ClientConfiguration)1 AwsClientBuilder (com.amazonaws.client.builder.AwsClientBuilder)1 DummySegment (com.amazonaws.xray.entities.DummySegment)1