Browse Source

Use method accessor not field

pull/6/head
Dave Syer 10 years ago
parent
commit
7e579c9a91
  1. 4
      spring-cloud-netflix-hystrix-amqp/src/main/java/org/springframework/cloud/netflix/hystrix/amqp/HystrixStreamAutoConfiguration.java
  2. 13
      spring-cloud-netflix-turbine-amqp/src/main/java/org/springframework/cloud/netflix/turbine/amqp/TurbineAmqpAutoConfiguration.java

4
spring-cloud-netflix-hystrix-amqp/src/main/java/org/springframework/cloud/netflix/hystrix/amqp/HystrixStreamAutoConfiguration.java

@ -111,11 +111,11 @@ public class HystrixStreamAutoConfiguration { @@ -111,11 +111,11 @@ public class HystrixStreamAutoConfiguration {
// TODO: set content type
/*
* .enrichHeaders(new ComponentConfigurer<HeaderEnricherSpec>() {
*
*
* @Override public void configure(HeaderEnricherSpec spec) {
* spec.header("content-type", "application/json", true); } })
*/
.handle(Amqp.outboundAdapter(this.amqpTemplate).exchangeName(
.handle(Amqp.outboundAdapter(amqpTemplate()).exchangeName(
HystrixConstants.HYSTRIX_STREAM_NAME)).get();
}

13
spring-cloud-netflix-turbine-amqp/src/main/java/org/springframework/cloud/netflix/turbine/amqp/TurbineAmqpAutoConfiguration.java

@ -25,7 +25,6 @@ import org.springframework.amqp.core.BindingBuilder; @@ -25,7 +25,6 @@ import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@ -70,18 +69,6 @@ public class TurbineAmqpAutoConfiguration { @@ -70,18 +69,6 @@ public class TurbineAmqpAutoConfiguration {
@Autowired(required = false)
private ObjectMapper objectMapper;
private RabbitTemplate amqpTemplate;
public RabbitTemplate amqpTemplate() {
if (this.amqpTemplate == null) {
RabbitTemplate amqpTemplate = new RabbitTemplate(connectionFactory());
Jackson2JsonMessageConverter converter = messageConverter();
amqpTemplate.setMessageConverter(converter);
this.amqpTemplate = amqpTemplate;
}
return this.amqpTemplate;
}
@Bean
public DirectExchange hystrixStreamExchange() {
DirectExchange exchange = new DirectExchange(HystrixConstants.HYSTRIX_STREAM_NAME);

Loading…
Cancel
Save