From 030a8e711199bcc1673ccaaab4dba607a8a08d27 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 10 May 2017 11:09:06 +0100 Subject: [PATCH] Remove Lombok from hystrix stream --- spring-cloud-netflix-hystrix-stream/pom.xml | 8 +-- .../stream/HystrixStreamProperties.java | 67 ++++++++++++++++++- .../hystrix/stream/HystrixStreamTask.java | 26 +++---- 3 files changed, 79 insertions(+), 22 deletions(-) diff --git a/spring-cloud-netflix-hystrix-stream/pom.xml b/spring-cloud-netflix-hystrix-stream/pom.xml index 0a41fdd4..9c05c847 100644 --- a/spring-cloud-netflix-hystrix-stream/pom.xml +++ b/spring-cloud-netflix-hystrix-stream/pom.xml @@ -60,12 +60,6 @@ eureka-client test - - org.projectlombok - lombok - compile - true - org.springframework.boot spring-boot-starter-test @@ -83,7 +77,7 @@ org.springframework.cloud - spring-cloud-stream-binder-rabbit + spring-cloud-stream-test-support test diff --git a/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamProperties.java b/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamProperties.java index 50fe3048..86db29d8 100644 --- a/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamProperties.java +++ b/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamProperties.java @@ -19,13 +19,10 @@ package org.springframework.cloud.netflix.hystrix.stream; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.cloud.netflix.hystrix.HystrixConstants; -import lombok.Data; - /** * @author Spencer Gibb */ @ConfigurationProperties("hystrix.stream.queue") -@Data public class HystrixStreamProperties { /** Flag to indicate that Hystrix Stream is enabled. Default is true. */ @@ -52,4 +49,68 @@ public class HystrixStreamProperties { /** The size of the metrics queue. This queue drains to the stream. Defaults to 1000. */ private int size = 1000; + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public boolean isPrefixMetricName() { + return prefixMetricName; + } + + public void setPrefixMetricName(boolean prefixMetricName) { + this.prefixMetricName = prefixMetricName; + } + + public boolean isSendId() { + return sendId; + } + + public void setSendId(boolean sendId) { + this.sendId = sendId; + } + + public String getDestination() { + return destination; + } + + public void setDestination(String destination) { + this.destination = destination; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public long getSendRate() { + return sendRate; + } + + public void setSendRate(long sendRate) { + this.sendRate = sendRate; + } + + public long getGatherRate() { + return gatherRate; + } + + public void setGatherRate(long gatherRate) { + this.gatherRate = gatherRate; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + } diff --git a/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTask.java b/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTask.java index 2af36637..2f6b4ee8 100644 --- a/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTask.java +++ b/spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTask.java @@ -22,16 +22,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.LinkedBlockingQueue; -import org.springframework.beans.BeansException; -import org.springframework.cloud.client.ServiceInstance; -import org.springframework.cloud.client.discovery.DiscoveryClient; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.MessageHeaders; -import org.springframework.messaging.support.MessageBuilder; -import org.springframework.scheduling.annotation.Scheduled; - import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; import com.netflix.hystrix.HystrixCircuitBreaker; @@ -42,7 +32,18 @@ import com.netflix.hystrix.HystrixThreadPoolKey; import com.netflix.hystrix.HystrixThreadPoolMetrics; import com.netflix.hystrix.util.HystrixRollingNumberEvent; -import lombok.extern.apachecommons.CommonsLog; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.springframework.beans.BeansException; +import org.springframework.cloud.client.ServiceInstance; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHeaders; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.scheduling.annotation.Scheduled; /** * @author Spencer Gibb @@ -50,8 +51,9 @@ import lombok.extern.apachecommons.CommonsLog; * @see com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsPoller (nested * private class MetricsPoller) */ -@CommonsLog public class HystrixStreamTask implements ApplicationContextAware { + + private static Log log = LogFactory.getLog(HystrixStreamTask.class); private MessageChannel outboundChannel;