Skip to content

Commit

Permalink
feat: arex.enable.debug config (#138)
Browse files Browse the repository at this point in the history
Co-authored-by: wildeslam <[email protected]>
  • Loading branch information
wildeslam and wildeslam authored Dec 26, 2023
1 parent 771a9cc commit b3235b5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arex-storage-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<artifactId>arex-storage-service</artifactId>
<groupId>com.arextest</groupId>
<version>1.0.55</version>
<version>1.0.56</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public class InstancesCollection extends BaseEntity {
private Map<String, String> tags;
private Map<String, String> systemEnv;
private Map<String, String> systemProperties;
private Map<String, String> extendField;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ public class InstancesConfiguration extends AbstractConfiguration {
private Map<String, String> tags;
private Map<String, String> systemEnv;
private Map<String, String> systemProperties;
private Map<String, String> extendField;
}
2 changes: 1 addition & 1 deletion arex-storage-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>arex-storage-service</artifactId>
<groupId>com.arextest</groupId>
<version>1.0.55</version>
<version>1.0.56</version>
</parent>

<profiles>
Expand Down
2 changes: 1 addition & 1 deletion arex-storage-web-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<parent>
<artifactId>arex-storage-service</artifactId>
<groupId>com.arextest</groupId>
<version>1.0.55</version>
<version>1.0.56</version>
</parent>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -61,6 +62,7 @@ public final class AgentRemoteConfigurationController {
private static final String EMPTY_TIME = "0";
private static final String LAST_MODIFY_TIME = "If-Modified-Since";
private static final String INCLUDE_SERVICE_OPERATIONS = "includeServiceOperations";

@Resource
private ConfigurableHandler<DynamicClassConfiguration> dynamicClassHandler;
@Resource
Expand Down Expand Up @@ -112,6 +114,12 @@ public Response load(@RequestBody AgentRemoteConfigurationRequest request) {
serviceCollectConfiguration.getRecordMachineCountLimit());
Set<String> recordingHosts =
instances.stream().map(InstancesConfiguration::getHost).collect(Collectors.toSet());
InstancesConfiguration sourceInstance = instances.stream()
.filter(instance -> Objects.equals(instance.getHost(), (request.getHost())))
.findFirst().orElse(null);
if (sourceInstance != null && sourceInstance.getExtendField() != null) {
body.getExtendField().putAll(sourceInstance.getExtendField());
}
if (recordingHosts.contains(request.getHost())) {
body.setTargetAddress(request.getHost());
} else {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -408,5 +408,5 @@
<url>https://github.com/arextest/arex-storage</url>


<version>1.0.55</version>
<version>1.0.56</version>
</project>

0 comments on commit b3235b5

Please sign in to comment.