Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Removing cached sender from Configuration.
Browse files Browse the repository at this point in the history
This allows the new instance to be up-to-date with of configuration changes.

Resolves #684
     * Adding a closed attribute on sender
     * Sender configuration is resolving again is sender is closed.
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
  • Loading branch information
ehsavoie committed Feb 14, 2020
1 parent 3e20f62 commit 82a2686
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
13 changes: 2 additions & 11 deletions jaeger-core/src/main/java/io/jaegertracing/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,6 @@ public SenderConfiguration getSenderConfiguration() {
*/
@Getter
public static class SenderConfiguration {
/**
* A custom sender set by our consumers. If set, nothing else has effect. Optional.
*/
private Sender sender;

/**
* The Agent Host. Has no effect if the sender is set. Optional.
*/
Expand Down Expand Up @@ -648,15 +643,11 @@ public SenderConfiguration withAuthPassword(String password) {
}

/**
* Returns a sender if one was given when creating the configuration, or attempts to create a sender based on the
* configuration's state.
* Returns a sender based on the configuration's state.
* @return the sender passed via the constructor or a properly configured sender
*/
public Sender getSender() {
if (sender == null) {
sender = SenderResolver.resolve(this);
}
return sender;
return SenderResolver.resolve(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,11 @@ public void testOverrideServiceName() {
@Test
public void testDefaultTracer() {
Configuration configuration = new Configuration("name");
assertNotNull(configuration.getTracer());
assertNotNull(configuration.getTracer());
JaegerTracer tracer = configuration.getTracer();
assertNotNull(tracer);
configuration.closeTracer();
tracer = configuration.getTracer();
assertNotNull(tracer);
configuration.closeTracer();
}

Expand Down

0 comments on commit 82a2686

Please sign in to comment.