Update to S-A 1.5.0

This commit is contained in:
Gary Russell
2015-09-09 13:15:33 -04:00
parent 440e314dca
commit 7dbbb4bc1b
6 changed files with 22 additions and 20 deletions

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples.spring</groupId>
<artifactId>spring-rabbit-helloworld</artifactId>
<version>1.4.5.RELEASE</version>
<version>1.5.0.RELEASE</version>
<packaging>jar</packaging>
<name>Spring AMQP Hello World</name>
<url>http://www.spring.io</url>
@@ -16,8 +16,8 @@
</description>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<spring.framework.version>4.1.6.RELEASE</spring.framework.version>
<spring.amqp.version>1.4.5.RELEASE</spring.amqp.version>
<spring.framework.version>4.2.1.RELEASE</spring.framework.version>
<spring.amqp.version>1.5.0.RELEASE</spring.amqp.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples.spring</groupId>
<artifactId>spring-rabbit-log4j</artifactId>
<version>1.4.5.RELEASE</version>
<version>1.5.0.RELEASE</version>
<packaging>war</packaging>
<name>Spring AMQP log4j</name>
<url>http://www.spring.io</url>
@@ -16,8 +16,8 @@
</description>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<spring.framework.version>4.1.6.RELEASE</spring.framework.version>
<spring.amqp.version>1.4.5.RELEASE</spring.amqp.version>
<spring.framework.version>4.2.1.RELEASE</spring.framework.version>
<spring.amqp.version>1.5.0.RELEASE</spring.amqp.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>

View File

@@ -4,7 +4,7 @@
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp-samples</artifactId>
<name>Spring AMQP Samples</name>
<version>1.4.5.RELEASE</version>
<version>1.5.0.RELEASE</version>
<packaging>pom</packaging>
<modules>
<module>helloworld</module>

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples.spring</groupId>
<artifactId>spring-rabbit-stocks</artifactId>
<version>1.4.5.RELEASE</version>
<version>1.5.0.RELEASE</version>
<packaging>war</packaging>
<name>Spring Rabbit Stocks</name>
<url>http://www.spring.io</url>
@@ -15,8 +15,8 @@
</description>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<spring.framework.version>4.1.6.RELEASE</spring.framework.version>
<spring.amqp.version>1.4.5.RELEASE</spring.amqp.version>
<spring.framework.version>4.2.1.RELEASE</spring.framework.version>
<spring.amqp.version>1.5.0.RELEASE</spring.amqp.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,20 +23,21 @@ import java.util.Random;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.amqp.rabbit.core.support.RabbitGatewaySupport;
import org.springframework.amqp.rabbit.core.RabbitGatewaySupport;
import org.springframework.amqp.rabbit.stocks.domain.Quote;
import org.springframework.amqp.rabbit.stocks.domain.Stock;
import org.springframework.amqp.rabbit.stocks.domain.StockExchange;
/**
* Rabbit implementation of the {@link MarketDataGateway} for sending Market data.
*
*
* @author Mark Pollack
* @author Mark Fisher
*/
public class RabbitMarketDataGateway extends RabbitGatewaySupport implements MarketDataGateway {
private static Log logger = LogFactory.getLog(RabbitMarketDataGateway.class);
private static Log logger = LogFactory.getLog(RabbitMarketDataGateway.class);
private static final Random random = new Random();
@@ -71,7 +72,7 @@ public class RabbitMarketDataGateway extends RabbitGatewaySupport implements Mar
private Quote generateFakeQuote() {
MockStock stock = this.stocks.get(random.nextInt(this.stocks.size()));
String price = stock.randomPrice();
String price = stock.randomPrice();
return new Quote(stock, price);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,22 +22,23 @@ import java.util.UUID;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.rabbit.core.support.RabbitGatewaySupport;
import org.springframework.amqp.rabbit.core.RabbitGatewaySupport;
import org.springframework.amqp.rabbit.stocks.domain.TradeRequest;
/**
* Rabbit implementation of {@link StockServiceGateway} to send trade requests to an external process.
*
*
* @author Mark Pollack
* @author Gary Russell
*/
public class RabbitStockServiceGateway extends RabbitGatewaySupport implements StockServiceGateway {
private String defaultReplyTo;
public void setDefaultReplyTo(String defaultReplyTo) {
this.defaultReplyTo = defaultReplyTo;
}
public void send(TradeRequest tradeRequest) {
getRabbitTemplate().convertAndSend(tradeRequest, new MessagePostProcessor() {
public Message postProcessMessage(Message message) throws AmqpException {